From: Jan Doskočil Date: Fri, 16 Aug 2024 09:08:39 +0000 (+0200) Subject: test_journal: correct potential for truncation in snprintf X-Git-Tag: v3.4.0~17^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc9fe7869dfd1b011591269469eea4f1fdfe4b60;p=thirdparty%2Fknot-dns.git test_journal: correct potential for truncation in snprintf fmt string is "i%d" - theoretically if the argument was eg INT_MIN this could've been 13 chars long, which is why gcc threw a warning --- diff --git a/tests/knot/test_journal.c b/tests/knot/test_journal.c index 748ab02d02..750fad8717 100644 --- a/tests/knot/test_journal.c +++ b/tests/knot/test_journal.c @@ -557,7 +557,7 @@ static knot_dname_t *tm_owner(const char *prefix, const knot_dname_t *apex) static knot_dname_t *tm_owner_int(int x, const knot_dname_t *apex) { - char buf[12] = { 0 }; + char buf[13] = { 0 }; (void)snprintf(buf, sizeof(buf), "i%d", x); return tm_owner(buf, apex); }