Compiler warning about possiable overflow in devname.c
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
New
|
Low
|
Unassigned |
Bug Description
I just compiled mount and got the following warning:
libblkid/
sprintf(path, "/sys/block/
In file included from /usr/include/
/usr/include/
return __builtin_
__bos (__s), __fmt, __va_arg_pack ());
Code preceding this does a length check to prevent overflow. However, the warning was still alarming. The attached patch switches sprintf to snprintf and ups the buffer size to 300. This will silence the compiler and support longer device names. There didn't appear to be any technical reason for the 256 byte limit. If there is we just get a different less alarming truncation warning. This also means we don't need the hard coded length check.
tags: | added: patch |
Changed in util-linux (Ubuntu): | |
importance: | Undecided → Low |
Hello Michael, thank you for your contribution to Ubuntu!
A bug report in Ubuntu is not exactly the correct way to report this, could you please try to submit it upstream?
The Ubuntu Sponsors team also only sponsors debdiffs, which has packaging changes as well as the patch. I am unsubscribing that team for now; please resubscribe them if this was incorrect.
Thanks again, and apologies for the delay in responding to this bug report.