Fix FN when unsigned ptrdiff_t is passed as %llu into scanf
This commit is contained in:
parent
703d86992d
commit
74c778c5f0
|
@ -898,6 +898,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
if (argInfo.typeToken->str() != "long" || !argInfo.typeToken->isLong())
|
||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||
else if (typesMatch(argInfo.typeToken->originalName(), "size_t") ||
|
||||
typesMatch(argInfo.typeToken->originalName(), "ptrdiff_t") ||
|
||||
argInfo.typeToken->originalName() == "uintmax_t")
|
||||
invalidScanfArgTypeError_int(tok, numFormat, specifier, &argInfo, true);
|
||||
} else if (argInfo.typeToken->str() != "long" || argInfo.typeToken->isLong())
|
||||
|
|
|
@ -1075,7 +1075,7 @@ private:
|
|||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","size_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","ssize_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","ptrdiff_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA_WIN32("%llu","unsigned long long","unsigned ptrdiff_t", "unsigned long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","unsigned ptrdiff_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","intmax_t", "signed long", "signed long long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","uintmax_t", "unsigned long", "unsigned long long");
|
||||
TEST_SCANF_WARN_AKA("%llu","unsigned long long","intptr_t", "signed long", "signed long long");
|
||||
|
|
Loading…
Reference in New Issue