[hackers] [dmenu] arg.h: fixed argv checks order || Lucas Gabriel Vuotto

From: <git_AT_suckless.org>
Date: Tue, 23 Feb 2016 00:31:42 +0100 (CET)

commit b3d9451c2ddfad7c1b10e9a868afed4d92b37e41
Author: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
AuthorDate: Mon Feb 22 11:03:36 2016 -0300
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Tue Feb 23 00:31:03 2016 +0100

    arg.h: fixed argv checks order
    
    This prevents accessing to a potentially out-of-bounds memory section.
    
    Signed-off-by: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>

diff --git a/arg.h b/arg.h
index ff1fd13..e94e02b 100644
--- a/arg.h
+++ b/arg.h
_AT_@ -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_;\
Received on Tue Feb 23 2016 - 00:31:42 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 23 2016 - 00:36:12 CET