< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

RE: [reSIProcate] crash when ServerPublication refresh


I can’t reproduce this problem using the SVN head.  If there is no contents then Helper::extractFromPkcs7 just returns a ConentsSecAttributes with mContent.get() as 0 and mAttributes.get() as 0.  There was a fix in REV 5068 to Helper::extractFromPkcs7.

 

Scott

 


From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Noiile
Sent: Tuesday, October 18, 2005 5:21 AM
To: resiprocate-devel
Subject: [reSIProcate] crash when ServerPublication refresh

 

resiprocate-devel, Hello

 

when Publication refresh, the PUBBLISH have no Contents, it will be crash at line 120 in function ServerPublication::dispatch().

Because Helper::extractFromPkcs7 will clone msg's content, but it is NULL;

 

I think mLastBody does not need update when publication refresh,

so I changed the code as follows, It runs well, but I am not sure it's right :

ServerPublication::dispatch()

{  

......   

     //mLastBody = Helper::extractFromPkcs7(msg, *mDum.getSecurity());//NOIILE: if msg have no body, it will crash at here.
      if (msg.getContents())
      {
         mLastBody = Helper::extractFromPkcs7(msg, *mDum.getSecurity());//NOIILE
         handler->onUpdate(getHandle(), mEtag, msg,
                           mLastBody.mContents.get(),
                           mLastBody.mAttributes.get(),
                           mExpires);
      }
      else
      {
         handler->onRefresh(getHandle(), mEtag, msg,
                            mLastBody.mContents.get(),
                            mLastBody.mAttributes.get(),
                            mExpires);
      }

}

 

 

2005-10-18