FFstrbuf: adds integer overflow checks to EnsureFreeNoCheck and EnsureFixedLengthFree

This commit is contained in:
Carter Li
2026-07-28 14:36:19 +08:00
parent 476cd67345
commit 1c3f0eb7c0
2 changed files with 32 additions and 10 deletions
+1 -1
View File
@@ -414,7 +414,7 @@ int main(void) {
ffStrbufInit(&strbuf);
ffStrbufEnsureFixedLengthFree(&strbuf, 0);
VERIFY(strbuf.length == 0);
VERIFY(strbuf.allocated == 0);
VERIFY(strbuf.allocated == 1);
ffStrbufDestroy(&strbuf);
// ffStrbufEnsureFixedLengthFree / empty buffer but oldFree >= newFree