From e590737451ca6a63b79c0876e5a1041efdee12b2 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 15 May 2004 21:40:58 +0000 Subject: [PATCH] Fix a bug where the interpreter could read a garbage buffer from the stack. --- src/Scripting/NasalSys.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index a8f913ee6..e8e0c676b 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -195,6 +195,7 @@ static naRef f_print(naContext c, naRef args) #define BUFLEN 1024 char buf[BUFLEN + 1]; buf[BUFLEN] = 0; // extra nul to handle strncpy brain damage + buf[0] = 0; // Zero-length in case there are no arguments char* p = buf; int buflen = BUFLEN; int n = naVec_size(args);