Fix potential buffer overflow
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 24 Jan 2008 01:20:48 +0000 (01:20 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 24 Jan 2008 01:20:48 +0000 (01:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46296 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Program.inc

index 3badb194d26cdc886c5a73ecf1b1fa22aa93fcc4..cb002132bfef05840d34e81a2f244fed5b58802e 100644 (file)
@@ -134,7 +134,7 @@ Program::ExecuteAndWait(const Path& path,
   }
 
   // Now build the command line.
-  char *command = reinterpret_cast<char *>(_alloca(len));
+  char *command = reinterpret_cast<char *>(_alloca(len+1));
   char *p = command;
 
   for (unsigned i = 0; args[i]; i++) {