From 3df816fcb8cad22e514f3990a1d2756958b50d0a Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 9 Sep 2024 14:58:26 +0100 Subject: [PATCH] librpc/ndr: Fix fuzz CI on latest tumbleweed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit running samba-fuzz CI job on latest tumbleweed docker image results in; ../../librpc/ndr/ndr_orpc.c: In function ‘ndr_print_DUALSTRINGARRAY’: ../../librpc/ndr/ndr_orpc.c:97:49: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 97 | snprintf(idx, sizeof(idx), "[%d]", i); | ^ ../../librpc/ndr/ndr_orpc.c:97:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 13 97 | snprintf(idx, sizeof(idx), "[%d]", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../librpc/ndr/ndr_orpc.c:105:49: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 105 | snprintf(idx, sizeof(idx), "[%d]", i); | ^ ../../librpc/ndr/ndr_orpc.c:105:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 13 105 | snprintf(idx, sizeof(idx), "[%d]", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../librpc/ndr/ndr_orpc.c: In function ‘ndr_print_STRINGARRAY’: ../../librpc/ndr/ndr_orpc.c:159:49: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 159 | snprintf(idx, sizeof(idx), "[%d]", i); | ^ ../../librpc/ndr/ndr_orpc.c:159:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 13 159 | snprintf(idx, sizeof(idx), "[%d]", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall Autobuild-User(master): Douglas Bagnall Autobuild-Date(master): Tue Sep 10 01:22:28 UTC 2024 on atb-devel-224 --- librpc/ndr/ndr_orpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/librpc/ndr/ndr_orpc.c b/librpc/ndr/ndr_orpc.c index 80d9870e260..90d828edcec 100644 --- a/librpc/ndr/ndr_orpc.c +++ b/librpc/ndr/ndr_orpc.c @@ -93,7 +93,7 @@ void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const st ndr->print(ndr, "STRING BINDINGS"); ndr->depth++; for (i=0;ar->stringbindings[i];i++) { - char idx[13]; /* 2^32 has 10 digits */ + char idx[14]; /* 2^32 has 10 digits */ snprintf(idx, sizeof(idx), "[%d]", i); ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); } @@ -101,7 +101,7 @@ void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const st ndr->print(ndr, "SECURITY BINDINGS"); ndr->depth++; for (i=0;ar->securitybindings[i];i++) { - char idx[13]; /* 2^32 has 10 digits */ + char idx[14]; /* 2^32 has 10 digits */ snprintf(idx, sizeof(idx), "[%d]", i); ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]); } @@ -155,7 +155,7 @@ void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, const struct ndr->print(ndr, "%-25s: STRINGARRAY", name); ndr->depth++; for (i=0;ar->stringbindings[i];i++) { - char idx[13]; /* 2^32 has 10 digits */ + char idx[14]; /* 2^32 has 10 digits */ snprintf(idx, sizeof(idx), "[%d]", i); ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); } -- 2.47.3