Object size overflow

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

Observation

Description

1

Buffer overflow

The place bounds violation occurred

2

Definition

The place the associated variable was defined

Examples


#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
}
        

Copyright © 2010, Intel Corporation. All rights reserved.