From: Ted Kremenek Date: Sat, 23 Feb 2008 01:11:40 +0000 (+0000) Subject: Fixed buffer overflow reported by Argiris Kirtzidis. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=57daefa1876b9fdb7aae88874cb394e57ab5ef21;p=oota-llvm.git Fixed buffer overflow reported by Argiris Kirtzidis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47517 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Bitcode/Reader/Deserialize.cpp b/lib/Bitcode/Reader/Deserialize.cpp index 8455d0e630f..113321fa26f 100644 --- a/lib/Bitcode/Reader/Deserialize.cpp +++ b/lib/Bitcode/Reader/Deserialize.cpp @@ -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; }