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

main/presencestate.c

index 207e2aacb888da6384286f66edb5f570efcef095..56c903cf288e675867376b324a6702a51e257850 100644 (file)
@@ -151,6 +151,9 @@ static enum ast_presence_state ast_presence_state_helper(const char *presence_pr
        char *label = ast_strdupa(presence_provider);
        int res = AST_PRESENCE_INVALID;
 
+       *subtype = NULL;
+       *message = NULL;
+
        if (check_cache) {
                res = presence_state_cached(presence_provider, subtype, message);
                if (res != AST_PRESENCE_INVALID) {