[reSIProcate] DUM: death penalty for not calling setRegistrationPersistenceManager in ServerRegistration.cxx?

Scott Godin sgodin at sipspectrum.com
Fri Jun 6 10:37:31 CDT 2014


Having a registration persistence manager installed is a requirement to use
ServerRegistrations.  This is a development error, so I think an assert is
appropriate.

BTW:  Please avoid cross-posting to both devel and users lists.  In this
case the devel list is more appropriate.  Thanks.  :)

Scott


On Fri, Jun 6, 2014 at 11:20 AM, John Gregg <jgregg at aylus.com> wrote:

>
> Throughout ServerRegistration.cxx, there is a lot of code that uses a
> local variable, database, like this:
>
>   RegistrationPersistenceManager *database = mDum.
> mRegistrationPersistenceManager;
> ...
>
>   contacts = database->getContacts(mAor);
>   database->unlockRecord(mAor);
>
> This code will crash if database is NULL, that is, if mDum.
> mRegistrationPersistenceManager is NULL. The only way it ever gets set is
> for someone (i.e. the app) to call DialogUsageManager::
> setRegistrationPersistenceManager(). I'm not sure of the use of this, and
> maybe it simply doesn't make sense to be doing any registrations without
> having called this accessor first, but even in that case, perhaps the uses
> of it should assert or throw an exception instead of just assuming the
> pointer is valid and using it. For my purposes, I simply wrapped all uses
> of database in "if (database) ..." which may not be the absolutely correct
> thing to do. I can post or email the diffs as directed if you all think
> what I did is appropriate. Otherwise, I just thought I'd mention it.
>
> regards,
>
> -John Gregg
>
> _______________________________________________
> 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/20140606/826e7313/attachment.htm>


More information about the resiprocate-devel mailing list