diff options
author | Jan Doskočil <jan.doskocil@nic.cz> | 2024-08-16 11:08:39 +0200 |
---|---|---|
committer | Jan Doskočil <jan.doskocil@nic.cz> | 2024-08-16 11:09:30 +0200 |
commit | dc9fe7869dfd1b011591269469eea4f1fdfe4b60 (patch) | |
tree | 5943b9a87498dc7a92bcb81e55224b795622c668 | |
parent | libknot: add EDE code 30 (diff) | |
download | knot-dc9fe7869dfd1b011591269469eea4f1fdfe4b60.tar.xz knot-dc9fe7869dfd1b011591269469eea4f1fdfe4b60.zip |
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
-rw-r--r-- | tests/knot/test_journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/knot/test_journal.c b/tests/knot/test_journal.c index 748ab02d0..750fad871 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); } |