[sr-dev] git:master:e5b8066e: pua_xmpp: init printbuf_len and detect when no uri is provided

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 1 08:52:16 CEST 2017


Module: kamailio
Branch: master
Commit: e5b8066e1e0f4a69a5d1161dd75aea67014314b5
URL: https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-01T08:51:57+02:00

pua_xmpp: init printbuf_len and detect when no uri is provided

---

Modified: src/modules/pua_xmpp/request_winfo.c

---

Diff:  https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5.diff
Patch: https://github.com/kamailio/kamailio/commit/e5b8066e1e0f4a69a5d1161dd75aea67014314b5.patch

---

diff --git a/src/modules/pua_xmpp/request_winfo.c b/src/modules/pua_xmpp/request_winfo.c
index 65964350ae..a79bf1b79f 100644
--- a/src/modules/pua_xmpp/request_winfo.c
+++ b/src/modules/pua_xmpp/request_winfo.c
@@ -38,7 +38,7 @@ int request_winfo(struct sip_msg* msg, char* uri, char* expires)
 {
 	subs_info_t subs;
 	struct sip_uri puri;
-	int printbuf_len;
+	int printbuf_len = 0;
 	char buffer[PRINTBUF_SIZE];
 	str uri_str;
 
@@ -55,13 +55,12 @@ int request_winfo(struct sip_msg* msg, char* uri, char* expires)
 		{
 			LM_ERR("bad owner SIP address!\n");
 			goto error;
-		} else
-		{
+		} else {
 			LM_DBG("using user id [%.*s]\n", printbuf_len,
 					buffer);
 		}
 	} 
-	if(puri.user.len<=0 || puri.user.s==NULL
+	if(printbuf_len == 0 || puri.user.len<=0 || puri.user.s==NULL
 			|| puri.host.len<=0 || puri.host.s==NULL)
 	{
 		LM_ERR("bad owner URI!\n");




More information about the sr-dev mailing list