From e5b8066e1e0f4a69a5d1161dd75aea67014314b5 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 1 Aug 2017 08:50:24 +0200 Subject: [PATCH] pua_xmpp: init printbuf_len and detect when no uri is provided --- src/modules/pua_xmpp/request_winfo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/pua_xmpp/request_winfo.c b/src/modules/pua_xmpp/request_winfo.c index 65964350aed..a79bf1b79fb 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");