Skip to content

Commit

Permalink
fix possible buffer overflow (#5)
Browse files Browse the repository at this point in the history
* fix possible buffer overflow
  • Loading branch information
OursDesCavernes authored Oct 31, 2019
1 parent 06fcc0e commit ab80227
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amdgpufand.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ int probe_cards()
for(i=0;i<cardnum;i++)
{
int fd;
char pathh[255];
char pathh[300];
sprintf(pathh, "/sys/class/hwmon/%s",epsc[i]->d_name);
if(isamdgpu(pathh) ==0 && card<MAX_CARDS )
{
char buffer[255],buf[6];
char buffer[300],buf[6];
sprintf(buffer, "/sys/class/hwmon/%s/pwm1",epsc[i]->d_name);
cards[card].pwmfd = open(buffer,O_RDWR);
if(cards[card].pwmfd<0)
Expand Down

0 comments on commit ab80227

Please sign in to comment.