ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit c552a7ee74f1e2658de6aaf3b67b1656dc920952
parent 90ad27b025f5e8fd5c2acb20a1cb3461ffe3b521
Author: Lucas Gabriel Vuotto <l.vuotto92@gmail.com>
Date:   Mon Feb 22 11:03:36 -0300

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@gmail.com>

Diffstat:
arg.h | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arg.h b/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_;\