[hackers][sbase][PATCH] arg.h: fixed argv checks order

From: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
Date: Fri, 19 Feb 2016 15:59:49 -0300

This prevents accessing to a potentially out-of-bounds memory section.

Signed-off-by: Lucas Gabriel Vuotto <l.vuotto92_AT_gmail.com>
---
 arg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
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_;\
-- 
1.9.1
--------------2960409F8124DD3429E4CA7E--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Feb 19 2016 - 21:12:09 CET