From 2f7851336bd78eb3cc40c0e576d6d4f8319106a6 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 21 Dec 2011 18:43:24 +0000 Subject: [PATCH] Fix out-of-bounds write when passing a map filename to Mapster32. git-svn-id: https://svn.eduke32.com/eduke32@2194 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index b5eb70f78..e3751050c 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -496,10 +496,11 @@ int32_t app_main(int32_t argc, const char **argv) } continue; } + if (!boardfilename[0]) { Bstrncpy(boardfilename, argv[i], BMAX_PATH); - boardfilename[i-BMAX_PATH] = 0; + boardfilename[BMAX_PATH-1] = 0; } } if (boardfilename[0] == 0)