Package: cppcheck
Version: 1.38-1
Severity: wishlist

Hi,

It would be great if cppcheck detected the two buffer overflows demonstrated 
on the attached test case.

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
int fd=0;

void foo(void)
{
        char    buf[10];
        ssize_t len;

	// this is detected:
	len = sizeof buf;
	buf[len] = '\0';

	// this is not:
        len = read (fd, buf, 100);

	// this one either:
        len = read (fd, buf, sizeof buf);
        buf[len] = '\0';
}

Reply via email to