================
@@ -771,6 +771,11 @@ static bool isNullTermPointer(const Expr *Ptr, ASTContext 
&Ctx) {
       if (MD->getName() == "c_str" && RD->getName() == "basic_string")
         return true;
   }
+  if (auto *CE = dyn_cast<CallExpr>(Ptr->IgnoreParenImpCasts())) {
+    const FunctionDecl *F = CE->getDirectCallee();
+    if (F && F->getIdentifier() && F->getName() == "strerror")
----------------
ojhunt wrote:

I think we should have an array of known function names or better yet some way 
to annotate functions/return types - I believe that the -fbounds-safety work 
includes such an attribute, but using that attribute would seem to depend on 
having bounds safety enabled, which I think is a stricter requirement than we 
want for this.

https://github.com/llvm/llvm-project/pull/175208
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to