Skip to content

Commit

Permalink
Remove the confusing use of BUFSIZE
Browse files Browse the repository at this point in the history
Reading BUFSIZ-1 chars (8091) into a BUFSIZE'd buffer (256) is dangerous.

Now only the macro BUFSIZ is used.

Thanks to @prspkt and @sauyon for pointing this out earlier.
  • Loading branch information
Matthias Schmitz committed Sep 12, 2021
1 parent 82d634f commit 43ed060
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int checkinterface(void)

int get_stat(void)
{
char buffer[BUFSIZE];
char buffer[BUFSIZ];
char *ptr;
char *devname;
unsigned long dump;
Expand Down
3 changes: 0 additions & 3 deletions src/linux.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
int checkinterface(void);
int get_stat(void);
#ifdef __linux__
#define BUFSIZE 256
#endif

0 comments on commit 43ed060

Please sign in to comment.