Fortify Tool Buffer overflow

397 Views Asked by At
char tmp[] = "hello world";
char *line;
size_t sz;

sz = strlen(tmp) +1;
line = (char*)malloc(sz);

if (line)
    memset(line, 0x00, sz);

Using a tool called Fortify, it flags the memset as a Buffer Overflow. Any one know why?

0

There are 0 best solutions below