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

From: <git_AT_suckless.org>
Date: Sat, 20 Feb 2016 09:24:03 +0100 (CET)

commit bbacab561ce953c1e4620d5a42334ca9e9701331
Author: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
AuthorDate: Fri Feb 19 15:59:49 2016 -0300
Commit: sin <sin_AT_2f30.org>
CommitDate: Sat Feb 20 08:23:57 2016 +0000

    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 de6ce94..0b23c53 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 Sat Feb 20 2016 - 09:24:03 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 20 2016 - 09:36:16 CET