From a805d779e84c9e0fd4905c031b291bc938fdc816 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 21 Sep 2016 19:24:08 +0000 Subject: [PATCH] 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 --- main/presencestate.c | 3 +++ 1 file changed, 3 insertions(+) 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;