[clang] [-Wunsafe-buffer-usage] Check isValueDependent before EvaluateAsBooleanCondition (PR #172091)
Ziqing Luo via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 12 14:01:58 PST 2025
================
@@ -2106,6 +2108,10 @@ class UnsafeLibcFunctionCallGadget : public WarningGadget {
// function that is not in any namespace:
if (!FD->isInStdNamespace() && !IsGlobalAndNotInAnyNamespace)
return false;
+ // If the call has a sole null-terminated argument, e.g., strlen,
+ // printf, atoi, we consider it safe:
+ if (CE->getNumArgs() == 1 && isNullTermPointer(CE->getArg(0), Ctx))
----------------
ziqingluo-90 wrote:
This is from downstream. It helped discovering the bug first.
https://github.com/llvm/llvm-project/pull/172091
More information about the cfe-commits
mailing list