From: Christian Göttsche Date: Mon, 11 Dec 2023 16:53:28 +0000 (+0100) Subject: lib: avoid format truncation X-Git-Tag: 4.15.0-rc1~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2e7edcd0048a5040c8e30f49572907aff98f311;p=thirdparty%2Fshadow.git lib: avoid format truncation commonio.c: In function 'commonio_unlock': commonio.c:487:49: warning: '.lock' directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] 487 | snprintf (lock, sizeof lock, "%s.lock", db->filename); | ^~~~~ commonio.c:487:17: note: 'snprintf' output between 6 and 1029 bytes into a destination of size 1024 487 | snprintf (lock, sizeof lock, "%s.lock", db->filename); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/lib/commonio.c b/lib/commonio.c index b3106103f..9afe5de01 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -467,7 +467,7 @@ static void dec_lock_count (void) int commonio_unlock (struct commonio_db *db) { - char lock[1024]; + char lock[1029]; if (db->isopen) { db->readonly = true;