error: format not a string literal and no format arguments [-Werror=format-security]
Categories
(Core :: Audio/Video, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: stransky, Assigned: glandium)
References
Details
Attachments
(1 file)
Fedora uses hardened Firefox builds, it produces this error:
2315 dist/include/mozilla/Logging.h:256 col 59: error: format not a string literal and no format arguments [-Werror=format-security]
2318 /home/komat/CVS/firefox/firefox-65.0.1/dom/media/systemservices/CamerasChild.cpp:24 col 19: note: in expansion of macro ‘MOZ_LOG’
#define MOZ_LOG(_module, _level, _args)
do {
const ::mozilla::LogModule* moz_real_module = _module;
if (MOZ_LOG_TEST(moz_real_module, _level)) {
mozilla::detail::log_print(moz_real_module, _level,
MOZ_LOG_EXPAND_ARGS _args);
}
} while (0)
CamerasChild.cpp:460
int CamerasChild::FocusOnSelectedSource(CaptureEngine aCapEngine,
const int aCaptureId) {
LOG((PRETTY_FUNCTION)); << here we come
Comment 1•4 years ago
|
||
I'm uncertain why this is a lint issue, could you explain please?
Reporter | ||
Comment 2•4 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #1)
I'm uncertain why this is a lint issue, could you explain please?
I just used the same component as Bug 1514782 which I used as a template. Please move to appropriate component if I'm wrong.
Comment 3•4 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #2)
(In reply to Mark Banner (:standard8) from comment #1)
I'm uncertain why this is a lint issue, could you explain please?
I just used the same component as Bug 1514782 which I used as a template. Please move to appropriate component if I'm wrong.
Sylvestre, could you explain please (or move them)?
Updated•4 years ago
|
Comment hidden (spam) |
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
PRETTY_FUNCTION and FUNCTION are not guaranteed to be a string
literal, and only string literals should be used as format strings. GCC
9 complains about this with -Werror=format-security.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/42478b7856c0 Don't use __PRETTY_FUNCTION__ or __FUNCTION__ as format strings. r=sylvestre
Comment 7•4 years ago
|
||
bugherder |
Description
•