Check for NUL terminator in MemoryPool::findString()

This commit is contained in:
Benoit Blanchon committed 2021-11-24 19:06:49 +01:00
1 parent 43b2e2e774
commit a27398e445
9 files changed
+64 -3

No files matched your search

+6
View File
@@ -37,6 +37,12 @@ class String {
return *this;
}
char operator[](unsigned int index) const {
if (index >= _str.size())
return 0;
return _str[index];
}
friend std::ostream& operator<<(std::ostream& lhs, const ::String& rhs) {
lhs << rhs._str;
return lhs;