In struct overflow detect

AlexeyAlexey Posts: 1

Hi,

I have simple source:

include <stdio.h>

include <stdint.h>

include <stdlib.h>

typedef struct sss{
uint8_t ss[255];
int *k;
uint8_t ss1[255];
} __sss
;

int main(){
struct __sss *d;
int i;

do {
d = (struct __sss *) malloc(sizeof(struct __sss));
} while (!d);

for( i = 0; i < 257;i++) {
d->ss[i] = 1 + i;
printf("%i\n",d->ss[i]);
}
free(d);
return 0;
}
Check with builtin://Flow Analysis Aggressive.properties not return any errors there. Maybe i need set some option for detect this type of errors?

C/C++ 10.3.4

Best Regards,
Alexey.

Sign In or Register to comment.