Skip to content

Commit

Permalink
pua_xmpp: init printbuf_len and detect when no uri is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 1, 2017
1 parent f359625 commit e5b8066
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/pua_xmpp/request_winfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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");
Expand Down

0 comments on commit e5b8066

Please sign in to comment.