Closed Bug 1435223 Opened 6 years ago Closed 6 years ago

LinuxGamepad.cpp: -Wformat-truncation warning on an snprintf

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

Details

Attachments

(1 file)

In file included from /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dom/gamepad/Unified_cpp_dom_gamepad0.cpp:110:
 /root/firefox-gcc-last/dom/gamepad/linux/LinuxGamepad.cpp: In member function 'void {anonymous}::LinuxGamepadService::AddDevice(mozilla::udev_device*)':
 /root/firefox-gcc-last/dom/gamepad/linux/LinuxGamepad.cpp:137:12: error: '%s' directive output may be truncated writing up to 127 bytes into a region of size between 112 and 126 [-Werror=format-truncation=]
             "%s-%s-%s",
             ^~~~~~~~~~
Another solution could be to truncate the "name" variable so that we are always until 128 bytes.
I did it the lazy way!
Comment on attachment 8947772 [details]
Bug 1435223 - Increase the size of idstring to avoid a warning

https://reviewboard.mozilla.org/r/217494/#review223300
Attachment #8947772 - Flags: review?(amarchesini) → review+
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/86e0f2c3cc2d
Increase the size of idstring to avoid a warning r=baku
https://hg.mozilla.org/mozilla-central/rev/86e0f2c3cc2d
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: