]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc/ndr: Fix fuzz CI on latest tumbleweed
authorNoel Power <noel.power@suse.com>
Mon, 9 Sep 2024 13:58:26 +0000 (14:58 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 10 Sep 2024 01:22:28 +0000 (01:22 +0000)
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 <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Tue Sep 10 01:22:28 UTC 2024 on atb-devel-224

librpc/ndr/ndr_orpc.c

index 80d9870e2605f3aa2cf6c973e534241acabb03f7..90d828edcec00e6f136f63560f2200b672c71616 100644 (file)
@@ -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]);
        }