]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a bug where the interpreter could read a garbage buffer from the stack.
authorandy <andy>
Sat, 15 May 2004 21:40:58 +0000 (21:40 +0000)
committerandy <andy>
Sat, 15 May 2004 21:40:58 +0000 (21:40 +0000)
src/Scripting/NasalSys.cxx

index a8f913ee682a5b92bd5782102240b992016cf868..e8e0c676b451c7f9cad2e45672068a2cd9afd42c 100644 (file)
@@ -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);