From 3627d4c840d9ff8a790e74bd511ba44d43c9d350 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 14 Mar 2012 23:26:59 +0000 Subject: [PATCH] app_chanisavail: Fix use of uninitialized variable. Ensure that status is set before it is used by resetting it during each loop iteration. This could have resulted in incorrect results from this app. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@359486 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_chanisavail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index 86ce34177b..bb1a492fb3 100644 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -152,7 +152,9 @@ static int chanavail_exec(struct ast_channel *chan, const char *data) } *number = '\0'; number++; - + + status = AST_DEVICE_UNKNOWN; + if (string_compare) { /* ast_parse_device_state checks for "SIP/1234" as a channel name. ast_device_state will ask the SIP driver for the channel state. */