]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix another "Possible programming error" bug.
authorMark Michelson <mmichelson@digium.com>
Tue, 20 Mar 2012 20:40:46 +0000 (20:40 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 20 Mar 2012 20:40:46 +0000 (20:40 +0000)
Similar to the previous commit, don't pass
a printf-generated string to ast_strlen_zero.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 5f6c37b07e7fdd92e9cbd4467b0e67dddc1cf03e..c3880db031215628565e0e6cb6c8d37bca82b245 100644 (file)
@@ -4452,17 +4452,18 @@ static int extension_presence_state_helper(struct ast_exten *e, char **subtype,
 {
        struct ast_str *hint_app = ast_str_thread_get(&extensionstate_buf, 32);
        char *presence_provider;
+       const char *app;
 
        if (!e || !hint_app) {
                return -1;
        }
 
-       ast_str_set(&hint_app, 0, "%s", ast_get_extension_app(e));
-       presence_provider = parse_hint_presence(hint_app);
-
-       if (ast_strlen_zero(presence_provider)) {
+       app = ast_get_extension_app(e);
+       if (ast_strlen_zero(app)) {
                return -1;
        }
+       ast_str_set(&hint_app, 0, "%s", app);
+       presence_provider = parse_hint_presence(hint_app);
 
        return ast_presence_state(presence_provider, subtype, message);
 }