From: William Lallemand Date: Tue, 4 Mar 2025 09:47:08 +0000 (+0100) Subject: TESTS: ist: fix wrong array size X-Git-Tag: v3.2-dev7~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ddd2c82a3521ad61398d24fa10f7483cd6518de8;p=thirdparty%2Fhaproxy.git TESTS: ist: fix wrong array size test_istzero() and test_istpad() has the wrong array size buf[] which lacks the space for the '\0'; Could be backported in every stable branches. --- diff --git a/tests/unit/ist.c b/tests/unit/ist.c index e0d2b00c7..3ea000cbf 100644 --- a/tests/unit/ist.c +++ b/tests/unit/ist.c @@ -68,7 +68,7 @@ int test_istnext() struct ist f_istpad(void *buf, const struct ist ist) { return istpad(buf, ist); } int test_istpad() { - char buf[5] = "xxxxx"; + char buf[6] = "xxxxx"; if (strncmp(istpad(buf, ist("foo")).ptr, "foo", 3) != 0) return __LINE__; @@ -106,7 +106,7 @@ int test_isttrim() struct ist f_istzero(struct ist ist, size_t size) { return istzero(ist, size); } int test_istzero() { - char buf[5] = "xxxxx"; + char buf[6] = "xxxxx"; if (istzero(ist2(buf, 5), 10).ptr != buf) return __LINE__;