Module: sip-router
Branch: 4.0
Commit: 977cbc8a78caa50cf822bd39c39e7838e97fa511
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=977cbc8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Feb 27 23:47:06 2014 +0100
registar: proper unlinking deleted contact to avoid invalid memory access
- based on a report and patch by Dragos Oancea
---
modules/registrar/save.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
index 8aaf912..48c214d 100644
--- a/modules/registrar/save.c
+++ b/modules/registrar/save.c
@@ -695,10 +695,10 @@ static inline int update_contacts(struct sip_msg* _m, urecord_t*
_r,
ptr=_r->contacts;
while(ptr)
{
- ptr0 = ptr;
+ ptr0 = ptr->next;
if(ptr!=c)
ul.delete_ucontact(_r, ptr);
- ptr=ptr0->next;
+ ptr=ptr0;
}
updated=1;
}
@@ -725,10 +725,10 @@ static inline int update_contacts(struct sip_msg* _m, urecord_t*
_r,
ptr=_r->contacts;
while(ptr)
{
- ptr0 = ptr;
+ ptr0 = ptr->next;
if(ptr!=c)
ul.delete_ucontact(_r, ptr);
- ptr=ptr0->next;
+ ptr=ptr0;
}
updated=1;
}