From: Russell Bryant Date: Wed, 14 Mar 2012 23:29:32 +0000 (+0000) Subject: app_chanisavail: Fix use of uninitialized variable. X-Git-Tag: 11.0.0-beta1~515 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45205716d7353ffef2ae5aea2154305c3160c97e;p=thirdparty%2Fasterisk.git 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. ........ Merged revisions 359486 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359491 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359495 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index fd88b91e1f..8eef4caaa8 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. */