Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 657476 - =net-fs/nfs-utils-2.3.2: gcc7 patch "Fixed format overflow warnings in mountd and nfsd"
Summary: =net-fs/nfs-utils-2.3.2: gcc7 patch "Fixed format overflow warnings in mountd...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-06-06 17:56 UTC by Greg Turner
Modified: 2019-09-02 05:45 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nfs-utils-2.3.2-sprintf-buffer-size-gcc7.patch (file_657476.txt,1.31 KB, text/plain)
2018-06-06 17:56 UTC, Greg Turner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Turner 2018-06-06 17:56:08 UTC
Created attachment 535040 [details]
nfs-utils-2.3.2-sprintf-buffer-size-gcc7.patch

two essentially identical failures:

nfsd.c: In function ‘main’:
nfsd.c:102:21: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 6 [-Werror=format-overflow=]
   sprintf(tag, "vers%d", i);
                     ^~
nfsd.c:102:3: note: ‘sprintf’ output between 6 and 16 bytes into a destination of size 10
   sprintf(tag, "vers%d", i);

and

mountd.c: In function ‘main’:
mountd.c:706:21: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 6 [-Werror=format-overflow=]
   sprintf(tag, "vers%d", vers);
                     ^~
mountd.c:706:3: note: ‘sprintf’ output between 6 and 16 bytes into a destination of size 10
   sprintf(tag, "vers%d", vers);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

In both cases gcc was smart enough to figure out that the buffer couldn't accommodate the range of possible integer values but not smart enough to figure out that the integer is always one digit, womp womp.

Solution is already upstream: http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff_plain;h=c3b776b8f198427bebc2e1b2eeec70b91894ccad;hp=fd5ccdc449a0ef79498191aecb3e44120e813618 and we should backport as this causes ebuild compile failure.