Bug 312457
| Summary: | [WTF][GLib] Clang 22 produces -Wunsafe-buffer-usage-in-format-attr-call warning spam in journald logging code | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | Web Template Framework | Assignee: | Adrian Perez <aperez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Adrian Perez
There are many instances of:
../Source/WTF/wtf/glib/SocketConnection.cpp:67:5: warning: formatting function 'wtfCompileTimeCheckPrintfSpecifier' is unsafe [-Wunsafe-buffer-usage-in-format-attr-call]
67 | RELEASE_LOG_FAULT_WITH_PAYLOAD(Process, makeString("Received invalid message ("_s, message.span(), "), closing SocketConnection"_s).utf8().data());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Source/WTF/wtf/Assertions.h:797:58: note: expanded from macro 'RELEASE_LOG_FAULT_WITH_PAYLOAD'
797 | #define RELEASE_LOG_FAULT_WITH_PAYLOAD(channel, message) SD_JOURNAL_SEND(channel, LOG_CRIT, __FILE__, _STRINGIFY(__LINE__), __func__, "%s", message)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Source/WTF/wtf/Assertions.h:789:5: note: expanded from macro 'SD_JOURNAL_SEND'
789 | wtfCompileTimeCheckPrintfSpecifier(__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Source/WTF/wtf/glib/SocketConnection.cpp:67:45: note: string argument is not guaranteed to be null-terminated
67 | RELEASE_LOG_FAULT_WITH_PAYLOAD(Process, makeString("Received invalid message ("_s, message.span(), "), closing SocketConnection"_s).utf8().data());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/62889
EWS
Committed 311363@main (427b518060e9): <https://commits.webkit.org/311363@main>
Reviewed commits have been landed. Closing PR #62889 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/174916146>