9564 cw: possible buffer overflow in cw

Review Request #1092 - Created May 30, 2018 and submitted

Information
Toomas Soome
illumos-gate
9564
a3cd8aa...
Reviewers
general
cw.c: In function 'prepctx':
cw.c:1325:33: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 2 [-Werror=format-truncation=]
      (void) snprintf(s, len, "-O%d", level);
                                 ^~
cw.c:1325:30: note: directive argument in the range [-2147483648, 5]
      (void) snprintf(s, len, "-O%d", level);
                              ^~~~~~
cw.c:1325:13: note: 'snprintf' output between 4 and 14 bytes into a destination of size 4
      (void) snprintf(s, len, "-O%d", level);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

  
Yuri Pankov
Toomas Soome
Yuri Pankov
Andy Fiddaman
Ken Mays
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...