Re: why this statement will cause analysis error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/10/2010 11:41 p.m., Lu Fan wrote:
memcpy(in->sz_a, out.sz_b,sizeof(in->sz_a));

the memcpy will cause analysis error? The tool reports Overrun.

Probably the tool would be happier if you used sizeof(out.sz_b) instead. At least that way, if the sizes differed, you would be reading outside a buffer instead of writing outside one.

Cheers,
Nicholas Sherlock



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux