[asterisk-commits] mmichelson: branch 1.8-digiumphones r360035 - /branches/1.8-digiumphones/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 20 15:40:51 CDT 2012


Author: mmichelson
Date: Tue Mar 20 15:40:46 2012
New Revision: 360035

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=360035
Log:
Fix another "Possible programming error" bug.

Similar to the previous commit, don't pass
a printf-generated string to ast_strlen_zero.


Modified:
    branches/1.8-digiumphones/main/pbx.c

Modified: branches/1.8-digiumphones/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8-digiumphones/main/pbx.c?view=diff&rev=360035&r1=360034&r2=360035
==============================================================================
--- branches/1.8-digiumphones/main/pbx.c (original)
+++ branches/1.8-digiumphones/main/pbx.c Tue Mar 20 15:40:46 2012
@@ -4452,17 +4452,18 @@
 {
 	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));
+	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);
-
-	if (ast_strlen_zero(presence_provider)) {
-		return -1;
-	}
 
 	return ast_presence_state(presence_provider, subtype, message);
 }




More information about the asterisk-commits mailing list