From: Russell Bryant Date: Wed, 2 Mar 2005 22:24:02 +0000 (+0000) Subject: prevent crash with some extra checks while doing authentication (bug #3686) X-Git-Tag: 1.0.11.1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee53dc7286cbf2bf0147cc6f4fdc7c7680595220;p=thirdparty%2Fasterisk.git prevent crash with some extra checks while doing authentication (bug #3686) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5121 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 8f6b185461..0f422d96bd 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3411,15 +3411,20 @@ static int vm_execmain(struct ast_channel *chan, void *data) logretries++; if (!valid) { if (skipuser || logretries >= maxlogins) { - if (ast_streamfile(chan, "vm-incorrect", chan->language)) - break; + if (ast_streamfile(chan, "vm-incorrect", chan->language)) { + ast_log(LOG_WARNING, "Unable to stream incorrect message\n"); + return -1; + } } else { if (useadsi) adsi_login(chan); - if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language)) - break; + if (ast_streamfile(chan, "vm-incorrect-mailbox", chan->language)) { + ast_log(LOG_WARNING, "Unable to stream incorrect mailbox message\n"); + return -1; + } } - ast_waitstream(chan, ""); + if (ast_waitstream(chan, "")) /* Channel is hung up */ + return -1; } } if (!valid && (logretries >= maxlogins)) {