[Kamailio-Devel] possible bug in re.c

Jan Janak jan at ryngle.com
Sun Mar 8 22:02:36 CET 2009


On 08-03 20:56, Daniel-Constantin Mierla wrote:
> Hello,
>
> On 03/08/2009 04:44 AM, Jan Janak wrote:
>> Hello,
>>
>> I think there might be a bug in re.c, the test checking the
>> size of the static buffer before doing memcpy on line 342 is missing.
>>   
> what version were you checking? re.c line 342 on trunk didn't match your  
> description.

The trunk (or more specifically the git mirror of the trunk). I meant the
following memcpy:
     

      /* ignore it */
   }
}
memcpy(dest, p, end-p);
        
rpl->len = (dest-rbuf)+(end-p);

I haven't really checked the code thoroughly, but it appears to me that there
might be a check missing to ensure that there is enough space in the
destination buffer before the memcpy, since dest is pointing to a static
buffer of a fixed size.

  Jan.







More information about the Devel mailing list