Harden security-sensitive input handling (#3045)

* harden security-sensitive input handling

* enable ctest failure checks in ci

* add valgrind leak smoke tests

* split tests into separate workflow
This commit is contained in:
Max Lv
2026-07-15 11:10:24 +08:00
committed by GitHub
parent fc8750f329
commit 5559eec939
33 changed files with 1392 additions and 365 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ test_balloc(void)
memset(&buf, 0, sizeof(buf));
int ret = balloc(&buf, 100);
assert(ret == 0);
assert(ret == 100);
(void)ret;
assert(buf.data != NULL);
assert(buf.capacity >= 100);
@@ -43,7 +43,7 @@ test_brealloc(void)
/* Grow the buffer */
int ret = brealloc(&buf, 10, 200);
assert(ret == 0);
assert(ret == 200);
(void)ret;
assert(buf.capacity >= 200);
assert(buf.len == 10);
@@ -70,7 +70,7 @@ test_bprepend(void)
dst.len = 4;
int ret = bprepend(&dst, &src, 200);
assert(ret == 0);
assert(ret == 10);
(void)ret;
assert(dst.len == 10);
assert(memcmp(dst.data, "HEADERBODY", 10) == 0);