Artful: Fix FTBS on test-rebuild-20170922
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tgt (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Build fails because gcc detects using an incorrect length (16 instead of 8) when doing an sprintf for vendor_id.
spc.c: In function ‘spc_lu_init’:
spc.c:2072:5: error: ‘%-16s’ directive output truncated writing 16 bytes into a region of size 9 [-Werror=
"%-16s", VENDOR_ID);
^~~~~
In file included from /usr/include/
/usr/include/
return __builtin_
__bos (__s), __fmt, __va_arg_pack ());
Additional issues:
smc.c: In function ‘build_ element_ descriptors’ : __snprintf_ chk’ output truncated before the last format character [-Werror= format- truncation= ]
^ stdio.h: 862:0,
from smc.c:32: x86_64- linux-gnu/ bits/stdio2. h:64:10: note: ‘__builtin_ __snprintf_ chk’ output 33 bytes into a destination of size 32 __snprintf_ chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~ __snprintf_ chk’ output truncated before the last format character [-Werror= format- truncation= ]
^ stdio.h: 862:0,
from smc.c:32: x86_64- linux-gnu/ bits/stdio2. h:64:10: note: ‘__builtin_ __snprintf_ chk’ output 33 bytes into a destination of size 32 __snprintf_ chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
smc.c:164:41: error: ‘__builtin_
snprintf((char *)&data[i], 32, "%-32s", s->volume_tag);
In file included from /usr/include/
/usr/include/
return __builtin_
__bos (__s), __fmt, __va_arg_pack ());
smc.c:166:41: error: ‘__builtin_
snprintf((char *)&data[i], 32, "%-32s", s->barcode);
In file included from /usr/include/
/usr/include/
return __builtin_
__bos (__s), __fmt, __va_arg_pack ());
I believe the size of the volume_tag element should be increased to 33 bytes.
smc.c:184:40: error: ‘%-10s’ directive output may be truncated writing between 10 and 36 bytes into a region of size 11 [-Werror= format- truncation= ]
^~ ~~~ stdio.h: 862:0,
from smc.c:32: x86_64- linux-gnu/ bits/stdio2. h:64:10: note: ‘__builtin_ __snprintf_ chk’ output between 11 and 37 bytes into a destination of size 11 __snprintf_ chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
snprintf((char *)&data[i + 28], 11, "%-10s", attr->scsi_sn);
In file included from /usr/include/
/usr/include/
return __builtin_
__bos (__s), __fmt, __va_arg_pack ());
scsi_sn is defined as 36 bytes long (+1 byte for termination). Question is whether truncation here would be accidental or desired...