Fixed buffer overflow reported by Argiris Kirtzidis.
authorTed Kremenek <kremenek@apple.com>
Sat, 23 Feb 2008 01:11:40 +0000 (01:11 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 23 Feb 2008 01:11:40 +0000 (01:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47517 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/Deserialize.cpp

index 8455d0e630f5ec9eb425af13666824280f9106f2..113321fa26f28c1fe548c84cc3bc52caf0501673 100644 (file)
@@ -324,7 +324,7 @@ char* Deserializer::ReadCStr(char* cstr, unsigned MaxLen, bool isNullTerm) {
     cstr[i] = (char) ReadInt();
   
   if (isNullTerm)
-    cstr[len+1] = '\0';
+    cstr[len] = '\0';
   
   return cstr;
 }