From 1b420a212e38760d801449932d1905cd74f98979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Tue, 8 May 2018 13:46:11 +0200 Subject: s3-printing: fix format-truncation in print_queue_update() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../source3/printing/printing.c: In function ‘print_queue_update’: ../source3/printing/printing.c:1809:42: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 244 [-Werror=format-truncation=] snprintf(key, sizeof(key), "MSG_PENDING/%s", sharename); ^~ ~~~~~~~~~ ../source3/printing/printing.c:1809:2: note: ‘snprintf’ output between 13 and 268 bytes into a destination of size 256 snprintf(key, sizeof(key), "MSG_PENDING/%s", sharename); BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider (cherry picked from commit 6326b3415f3e225aafd5912d0965c80abcd7b22c) --- source3/printing/printing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/printing/printing.c b/source3/printing/printing.c index e4bb1d84f69..38d718045a1 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1693,7 +1693,7 @@ extern pid_t background_lpq_updater_pid; static void print_queue_update(struct messaging_context *msg_ctx, int snum, bool force) { - fstring key; + char key[268]; fstring sharename; char *lpqcommand = NULL; char *lprmcommand = NULL; -- cgit v1.2.1