From c0accce690c2802ff29142185137fcc3dd6b7a5e Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 23 Jan 2017 13:01:59 -0600 Subject: [PATCH] getopt: add some padding to EMSG to avoid overrun --- getopt_long.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/getopt_long.c b/getopt_long.c index c1e1404..afeb68d 100644 --- a/getopt_long.c +++ b/getopt_long.c @@ -83,7 +83,8 @@ char *pkg_optarg; /* argument associated with option */ #define BADARG ((*options == ':') ? (int)':' : (int)'?') #define INORDER (int)1 -#define EMSG "" +/* add some padding to EMSG to avoid overrun */ +#define EMSG "\0\0\0\0" #ifdef GNU_COMPATIBLE #define NO_PREFIX (-1)