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

From: <git_AT_suckless.org>
Date: Sun, 21 Feb 2016 17:22:02 +0100 (CET)

commit 4fdba860c8db70035e9749806ecc6ca2d7c418d0
Author: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
AuthorDate: Fri Feb 19 15:59:49 2016 -0300
Commit: Christoph Lohmann <20h_AT_r-36.net>
CommitDate: Sun Feb 21 17:21:41 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>
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/arg.h b/arg.h
index a94e6b5..ba3fb3f 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 Sun Feb 21 2016 - 17:22:02 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 21 2016 - 17:24:12 CET