Module: sip-router
Branch: master
Commit: 319a966497a0dc85b5f1a2e43ecae56cd515b902
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=319a966…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue May 29 11:11:49 2012 +0200
registrar(k): check if realm prefix len is >0
---
modules_k/registrar/common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/registrar/common.c b/modules_k/registrar/common.c
index 3cd235f..c8a1948 100644
--- a/modules_k/registrar/common.c
+++ b/modules_k/registrar/common.c
@@ -95,7 +95,7 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu)
/* strip prefix (if defined) */
realm_prefix.s = cfg_get(registrar, registrar_cfg, realm_pref).s;
realm_prefix.len = cfg_get(registrar, registrar_cfg, realm_pref).len;
- if (realm_prefix.len && realm_prefix.len<puri->host.len &&
+ if (realm_prefix.len>0 && realm_prefix.len<puri->host.len &&
(memcmp(realm_prefix.s, puri->host.s, realm_prefix.len)==0) ) {
memcpy(aor_buf + _a->len, puri->host.s + realm_prefix.len,
puri->host.len - realm_prefix.len);