Re: question about smatch error

From: Dan Carpenter
Date: Mon Jan 17 2011 - 01:06:52 EST


On Sun, Jan 16, 2011 at 09:02:52PM -0800, Roland Dreier wrote:
> where eui is a u8*, and I don't see how smatch even thinks it knows how
> big the buffer is in the first place.
>

It comes from the memcpy:

memcpy(eui, dev->dev_addr, 3);
memcpy(eui + 5, dev->dev_addr + 3, 3);

The first line means smatch thinks "eui" is a 3 char buffer. The second
line gets ignored but normally smatch would see "eui + 5" as a separate
buffer.

Really when it sees the memcpy() that's just a guess about the size,
I'll disable it by default unless you use the --spammy option.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/