Skip to content

Commit

Permalink
arg.h: fixed argv checks order
Browse files Browse the repository at this point in the history
This prevents accessing to a potentially out-of-bounds memory section.

Signed-off-by: Lucas Gabriel Vuotto <[email protected]>
  • Loading branch information
lvuotto authored and hiltjo committed Feb 22, 2016
1 parent 3de85ca commit b3d9451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extern char *argv0;

/* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][1]\
&& argv[0][0] == '-';\
argv[0] && argv[0][0] == '-'\
&& argv[0][1];\
argc--, argv++) {\
char argc_;\
char **argv_;\
Expand Down

0 comments on commit b3d9451

Please sign in to comment.