[llvm-commits] [llvm] r46296 - /llvm/trunk/lib/System/Win32/Program.inc

Anton Korobeynikov asl at math.spbu.ru
Wed Jan 23 17:20:48 PST 2008


Author: asl
Date: Wed Jan 23 19:20:48 2008
New Revision: 46296

URL: http://llvm.org/viewvc/llvm-project?rev=46296&view=rev
Log:
Fix potential buffer overflow

Modified:
    llvm/trunk/lib/System/Win32/Program.inc

Modified: llvm/trunk/lib/System/Win32/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Program.inc?rev=46296&r1=46295&r2=46296&view=diff

==============================================================================
--- llvm/trunk/lib/System/Win32/Program.inc (original)
+++ llvm/trunk/lib/System/Win32/Program.inc Wed Jan 23 19:20:48 2008
@@ -134,7 +134,7 @@
   }
 
   // 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++) {





More information about the llvm-commits mailing list