[reSIProcate] Resiprocate crash when rejecting a subscribe that have expires set to 0 with 404

Ionut Slaveanu islaveanu at ezuce.com
Tue Apr 1 00:03:25 CDT 2014


Hi Scott,
I attached the patch to this email. Can you review it and commit if is ok.
Another solution would be to remove the code that handle the expire set to
0 in a subscription from ServerSubscription::dispatch function, I mean if
(mExpires == 0){...}. and let the application to handle this situation in
onNewSubscription callback.

Thank you!


On Fri, Mar 28, 2014 at 9:11 PM, Scott Godin <sgodin at sipspectrum.com> wrote:

> Sounds like we need to fixup this code.  If you have a fix for this,
> please feel free to contribute it.
>
> Thanks,
> Scott Godin
>
>
> On Fri, Mar 28, 2014 at 5:47 AM, Ionut Slaveanu <islaveanu at ezuce.com>wrote:
>
>> Hi guys,
>>
>> The scenario is the following:
>> We implemented a resource list server with resiprocate and in
>> ServerSubscriptionHandler::onNewSubscription we reject a subscribtion that
>> have expires set to 0 to an unexistent resource with 404.
>> So in ServerSubscriptionHandler::onNewSubscription we call:
>> subscriptionHandle->send(subscriptionHandle->reject(404));
>>
>> The problem is that ServerSubscription::send calls:
>>           if (shouldDestroyAfterSendingFailure(*msg))
>> 129│          {
>> 130├>            DialogUsage::send(msg);
>> 131│             handler->onTerminated(getHandle());
>> 132│             delete this;
>> 133│             return;
>> 134│          }
>>
>> which deletes the subscriptionHandle. Then ServerSubscription::dispatch
>> calls:
>>          makeNotifyExpires();
>>          handler->onExpiredByClient(getHandle(), msg, *mLastRequest);
>>
>>          mDialog.makeResponse(*mLastResponse, mLastSubscribe, 200);
>>          mLastResponse->header(h_Expires).value() = mExpires;
>>          send(mLastResponse);
>>
>>          send(mLastRequest);  // Send Notify Expires
>>
>> Currently, resiprocate crashes in makeNotifyExpires, which tries to use
>> members from the class which were already deleted.
>>
>> Is there a way to reject a subscribe that have expires set to 0 with 404?
>> Currently the resiprocate code also tries to send the notify when expires
>> is set to 0.
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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/20140401/9201cfd3/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.patch
Type: text/x-patch
Size: 4329 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140401/9201cfd3/attachment.bin>


More information about the resiprocate-devel mailing list