diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-09-09 17:06:15 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-09-11 15:16:26 +0100 |
commit | 2e4ec891dadb49965f9de900082d2fd3e52a6577 (patch) | |
tree | c56eab743ccaa2b8e643b5dc59b71c7348080bda /Userland/Libraries/LibCore | |
parent | 7dfecbee4471d9e34b9a8f099479ff30f145ea4e (diff) | |
download | serenity-2e4ec891dadb49965f9de900082d2fd3e52a6577.zip |
Everywhere: Fix format-vulnerabilities
Command used:
grep -Pirn '(out|warn)ln\((?!["\)]|format,|stderr,|stdout,|output, ")' \
AK Kernel/ Tests/ Userland/
(Plus some manual reviewing.)
Let's pick ArgsParser as an example:
outln(file, m_general_help);
This will fail at runtime if the general help happens to contain braces.
Even if this transformation turns out to be unnecessary in a place or
two, this way the code is "more obviously" correct.
Diffstat (limited to 'Userland/Libraries/LibCore')
-rw-r--r-- | Userland/Libraries/LibCore/ArgsParser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 54a362331f..dfb027e276 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -201,7 +201,7 @@ void ArgsParser::print_usage(FILE* file, const char* argv0) if (m_general_help != nullptr && m_general_help[0] != '\0') { outln(file, "\nDescription:"); - outln(file, m_general_help); + outln(file, "{}", m_general_help); } if (!m_options.is_empty()) |