[sr-dev] git:master: modules_k/registrar_k: added check that reg-id is not zero

admin at sip-router.org admin at sip-router.org
Fri Dec 7 01:06:52 CET 2012


Module: sip-router
Branch: master
Commit: 08c872ed6935396cd6ea87af52af6393987d6d7d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=08c872ed6935396cd6ea87af52af6393987d6d7d

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Fri Dec  7 02:05:49 2012 +0200

modules_k/registrar_k: added check that reg-id is not zero

---

 modules_k/registrar/save.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules_k/registrar/save.c b/modules_k/registrar/save.c
index 3188050..06bf559 100644
--- a/modules_k/registrar/save.c
+++ b/modules_k/registrar/save.c
@@ -364,7 +364,7 @@ static inline ucontact_info_t* pack_ci( struct sip_msg* _m, contact_t* _c,
 		if(_c->instance!=NULL && _c->instance->body.len>0)
 			ci.instance = _c->instance->body;
 		if(_c->instance!=NULL && _c->reg_id!=NULL && _c->reg_id->body.len>0) {
-			if(str2int(&_c->reg_id->body, &ci.reg_id)<0)
+			if(str2int(&_c->reg_id->body, &ci.reg_id)<0 || ci.reg_id==0)
 			{
 				LM_ERR("invalid reg-id value\n");
 				goto error;




More information about the sr-dev mailing list