From c57ba0384aa3b30ff1cbb2516c86e478b010ff30 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Mon, 22 Feb 2016 11:03:36 -0300 Subject: [PATCH] arg.h: fixed argv checks order This prevents accessing to a potentially out-of-bounds memory section. Signed-off-by: Lucas Gabriel Vuotto --- dmenubar/arg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmenubar/arg.h b/dmenubar/arg.h index ff1fd13..e94e02b 100644 --- a/dmenubar/arg.h +++ b/dmenubar/arg.h @@ -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_;\