[reSIProcate] race condition when Data::c_str

Scott Godin sgodin at sipspectrum.com
Mon Feb 3 09:42:35 CST 2014


I'm not sure I follow what the problem is.
Data d(msg.methodStr());
should use the const Data& constructor, which copies the string from
methodStr()

However I could see how just calling msg.methodStr().c_str() could end up
inserting the 0, however I'm not sure I see what problems a race condition
here would cause, unless c_str needed to resize.

Can you please explain this issue in more detail?

Thanks,
Scott




On Mon, Feb 3, 2014 at 10:24 AM, palladin <p-aladin at yandex.ru> wrote:

> Dear resip devels,
> There is small issue with rutil::Data.
> Please consider next scenario:
> resip::MethodNames from MethodTypes.cxx
> SipMessage msg
> rutil::Data d( msg.methodStr() );
>
> When you call d.c_str() - original MethodNames will be rewritten in
> Data::c_str() when assigning zero to mBuf[mSize].
>
> Sincerely, tez.
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140203/1026386b/attachment.htm>


More information about the resiprocate-devel mailing list