Strings are NULL terminated. So the region size should plus one.

llvm-svn: 59943
This commit is contained in:
Zhongxing Xu
2008-11-24 05:16:01 +00:00
parent 87da2b5dce
commit f556cd6cb9
2 changed files with 2 additions and 2 deletions

View File

@@ -275,7 +275,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St,
const StringLiteral* Str = SR->getStringLiteral();
// We intentionally made the size value signed because it participates in
// operations with signed indices.
return NonLoc::MakeVal(getBasicVals(), Str->getByteLength(), false);
return NonLoc::MakeVal(getBasicVals(), Str->getByteLength() + 1, false);
}
if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {