From 08eaf1f59f3b038be68c3bc151056b3c877b73f9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 27 Sep 2016 10:07:47 -0400 Subject: [PATCH] Fixed buffer overflow. --- lx_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lx_loader.c b/lx_loader.c index a03b720..0e14641 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -249,7 +249,7 @@ static __attribute__((noreturn)) void runLxModule(const LxModule *lxmod, const i // !!! FIXME: eventually, the environment table looks like this (double-null to terminate list): var1=a\0var2=b\0var3=c\0\0 // The command line, if I'm reading the Open Watcom __OS2Main() implementation correctly, looks like this... // \0programname\0argv0\0argv1\0argvN\0 - size_t len = 0; + size_t len = strlen(argv[0]) + 1; for (int i = 0; i < argc; i++) { len += strlen(argv[i]) + 1; }