Static Analysis Problem Type Reference
Buffer overflow due to misuse of string function.
This diagnostic covers several usage errors related to string manipulation functions such as strcat and strcpy.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Buffer overflow |
The place where the string function was used |
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
char buf[16];
strcpy(buf, argv[0]); // unsafe
printf("%s\n", buf);
return 0;
}