Files
codeql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousSizeof.cpp
2018-09-23 16:23:52 -07:00

5 lines
153 B
C++

void f(char s[]) {
int size = sizeof(s); //wrong: s is now a char*, not an array.
//sizeof(s) will evaluate to sizeof(char *)
}