Check for null pointers being passed as arguments to C string functions. There are no clang-analyzer-unix.cstring.NullArg warnings in mozilla-central! strlen strnlen strcpy strncpy strcat strncat strcmp strncmp strcasecmp strncasecmp https://clang-analyzer.llvm.org/available_checks.html MozReview-Commit-ID: EkfaItfo5cu
15 lines
219 B
C++
15 lines
219 B
C++
// https://clang-analyzer.llvm.org/available_checks.html
|
|
|
|
#include "structures.h"
|
|
|
|
int my_strlen(const char* s)
|
|
{
|
|
return strlen(s); // warning
|
|
}
|
|
|
|
int bad_caller()
|
|
{
|
|
const char* s = nullptr;
|
|
return my_strlen(s);
|
|
}
|