Module: sip-router
Branch: master
Commit: f76bd09d4800ea63552c11002d7f6f72569e78ed
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f76bd09…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Jan 22 13:40:11 2013 +0100
pua_reginfo: fix setting lengths of contact attributes
- fix also for warning from FS#255 reported by Ovidiu Sas
---
modules/pua_reginfo/notify.c | 29 +++++++++++++++++------------
1 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/modules/pua_reginfo/notify.c b/modules/pua_reginfo/notify.c
index 499cccb..a6f7428 100644
--- a/modules/pua_reginfo/notify.c
+++ b/modules/pua_reginfo/notify.c
@@ -296,22 +296,27 @@ int process_body(str notify_body, udomain_t * domain) {
callid.len = strlen(callid.s);
received.s = xmlGetAttrContentByName(contacts, "received");
if (received.s == NULL) {
- LM_DBG("No received for this
contact!\n");
- }
- received.len - strlen(received.s);
+ LM_DBG("No received for this contact!\n");
+ received.len = 0;
+ } else {
+ received.len = strlen(received.s);
+ }
path.s = xmlGetAttrContentByName(contacts, "path");
- if (received.s == NULL) {
- LM_DBG("No path for this contact!\n");
- }
- path.len = strlen(path.s);
+ if (path.s == NULL) {
+ LM_DBG("No path for this contact!\n");
+ path.len = 0;
+ } else {
+ path.len = strlen(path.s);
+ }
user_agent.s = xmlGetAttrContentByName(contacts, "user_agent");
- if (received.s == NULL) {
- LM_DBG("No user_agent for this
contact!\n");
- }
- user_agent.len = strlen(user_agent.s);
-
+ if (user_agent.s == NULL) {
+ LM_DBG("No user_agent for this contact!\n");
+ user_agent.len = 0;
+ } else {
+ user_agent.len = strlen(user_agent.s);
+ }
event = reginfo_parse_event(xmlGetAttrContentByName(contacts, "event"));
if (event == EVENT_UNKNOWN) {
LM_ERR("No event for this contact!\n");