Static Analysis Problem Type Reference
Buffer overflow error at block assignment operation.
This error indicates that the destination size is too small to accommodate the data being moved to the destination. This occurs during an assignment of structured data types, either at an assignment statement or through a library routine such as memcpy.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Buffer overflow |
The place bounds violation occurred |
|
2 |
Definition |
The place where the associated variable was defined |
#include <stdlib.h>
int main(int argc, char **argv)
{
char x[10];
char y[20];
memset(y, 0, 21); // overflows y
memcpy(x, y, 11); // overflows x
}