[reSIProcate] rutil/DataBuffer.cxx: likely signed-ness problem

Kennard White kennard_white at logitech.com
Mon Dec 20 23:04:01 CST 2010


Hi,

Static code analysis indicates a likely problem in rutil/DataBuffer.cxx:

int
DataBuffer::overflow(int c)
{
   // sync, but reallocate
   size_t len = pptr() - pbase();
   if (len >= 0)
   {


Since size_t is unsigned, the if statement is always true. My guess is that
the original author wanted len to be a signed type. But I have no idea what
this function does. Anyone?

Kennard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101220/bcd4f50c/attachment.htm>


More information about the resiprocate-devel mailing list