butc: fix format overflow warning 16/12916/2
authorMichael Meffie <mmeffie@sinenomine.net>
Mon, 19 Feb 2018 18:57:16 +0000 (13:57 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 9 Mar 2018 13:50:16 +0000 (08:50 -0500)
commitcec45d59440f55316097cfd6652d2ea26cd55233
tree234ca6e78de694b53dc72c3a2d55d7dc0141454a
parentc44f6f7a8052bdd1fb021e07bb6ae142b61e6b5b
butc: fix format overflow warning

Recent versions of gcc generate an overflow warning in the butc DUMPNAME macro
when copying values into the finishedMsg1 buffer. Increase the size of the
destination buffer to avoid a possible buffer overflow.

    dump.c:88:24: error: ‘%s’ directive writing up to 63 bytes into
    a region of size 50 [-Werror=format-overflow=]
          sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
                            ^
    dump.c:1294:5: note: in expansion of macro ‘DUMPNAME’
         DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId);
         ^~~~~~~~
    dump.c:88:6: note: ‘sprintf’ output between 12 and 84 bytes into
    a destination of size 50
          sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    dump.c:1294:5: note: in expansion of macro ‘DUMPNAME’
         DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId);
         ^~~~~~~~

Change-Id: Iadf87a308ab6c500a8407a269bc0fd443ff0c735
Reviewed-on: https://gerrit.openafs.org/12916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/butc/dump.c