1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

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.
This commit is contained in:
Ben Wiederhake 2021-09-09 17:06:15 +02:00 committed by Linus Groh
parent 7dfecbee44
commit 2e4ec891da
4 changed files with 4 additions and 4 deletions

View file

@ -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())