]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
core: Ensure presencestate subtype and message are NULL. 57/3957/1
authorJoshua Colp <jcolp@digium.com>
Wed, 21 Sep 2016 19:24:08 +0000 (19:24 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 21 Sep 2016 19:24:08 +0000 (19:24 +0000)
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

index 3be2ebeede2c2bc74179dd5ab3b14551afe8a1a8..c0a0ebdc194ea6d7cea43913df2a743d5f5603b1 100644 (file)
@@ -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;