From: Joshua Colp Date: Wed, 21 Sep 2016 19:24:08 +0000 (+0000) Subject: core: Ensure presencestate subtype and message are NULL. X-Git-Tag: 14.1.0-rc1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F3957%2F1;p=thirdparty%2Fasterisk.git core: Ensure presencestate subtype and message are NULL. When retrieving presence state information there is no guarantee that the subtype and message passed in are set to NULL. This change ensures they are. ASTERISK-26397 #close Change-Id: If38cd730e409e9a9b6eb9adef6591d15a9e61f86 --- diff --git a/main/presencestate.c b/main/presencestate.c index 3be2ebeede..c0a0ebdc19 100644 --- a/main/presencestate.c +++ b/main/presencestate.c @@ -161,6 +161,9 @@ static enum ast_presence_state ast_presence_state_helper(const char *presence_pr [AST_PRESENCE_DND] = 7 }; + *subtype = NULL; + *message = NULL; + while ((label = strsep(&labels, "&"))) { enum ast_presence_state next_state = AST_PRESENCE_INVALID; char *next_subtype = NULL;