diff --git a/lib/checkdangerousfunctions.cpp b/lib/checkdangerousfunctions.cpp index e1f7d5447..790996611 100644 --- a/lib/checkdangerousfunctions.cpp +++ b/lib/checkdangerousfunctions.cpp @@ -62,10 +62,13 @@ void CheckDangerousFunctions::dangerousFunctionmktemp(const Token *tok) void CheckDangerousFunctions::dangerousFunctiongets(const Token *tok) { - reportError(tok, Severity::style, "dangerousFunctiongets", "Found 'gets'. You should use 'fgets' instead"); + reportError(tok, Severity::style, "dangerousFunctiongets", "Found 'gets'. You should use 'fgets' instead\n" + "Using gets can easily cause buffer overflows."); } void CheckDangerousFunctions::dangerousFunctionscanf(const Token *tok) { - reportError(tok, Severity::style, "dangerousFunctionscanf", "Found 'scanf'. You should use 'fgets' instead"); + reportError(tok, Severity::style, "dangerousFunctionscanf", "Found 'scanf'. You should use 'fgets' instead\n" + "If reading a string the 'scanf' can easily cause a buffer overflow if the data is too big.\n" + "If you want to convert the input to a number a wrong input may cause a crash."); }