GNU bug report logs - #32230
27.0.50; GCC 7 warning due to -Wformat-overflow

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Fri, 20 Jul 2018 22:03:01 UTC

Severity: normal

Found in version 27.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ken Brown <kbrown <at> cornell.edu>
To: 32230 <at> debbugs.gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow
Date: Fri, 20 Jul 2018 18:02:07 -0400
The Cygwin-w32 build has turned up another GCC 7 warning:

../../master/src/w32term.c: In function ‘x_draw_glyph_string’:
../../master/src/w32term.c:1477:27: warning: ‘__builtin___sprintf_chk’ 
may write a terminating nul past the end of the destination 
[-Wformat-overflow=]
    sprintf ((char *) buf, "%0*X",
                           ^
../../master/src/w32term.c:1477:4: note: ‘__builtin___sprintf_chk’ 
output between 5 and 8 bytes into a destination of size 7
    sprintf ((char *) buf, "%0*X",
    ^
The method that Paul used in bug#32189 could be used here too, but I'm
not sure it's worth the trouble.  My inclination is to just increase the
buffer size from 7 to 8.

Ken





This bug report was last modified 7 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.