From: Tilghman Lesher Date: Thu, 14 May 2009 16:22:14 +0000 (+0000) Subject: If the timing ended on a zero, then we would loop forever. X-Git-Tag: 11.0.0-beta1~4892 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a3797643c7e635fcf5b73b92648aeeb606e9b97;p=thirdparty%2Fasterisk.git If the timing ended on a zero, then we would loop forever. (closes issue #14983) Reported by: teox Patches: 20090513__issue14983.diff.txt uploaded by tilghman (license 14) Tested by: teox git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194430 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index a0083a0af1..2a10e9b001 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -7083,11 +7083,10 @@ static unsigned get_range(char *src, int max, char *const names[], const char *m /* Fill the mask. Remember that ranges are cyclic */ mask |= (1 << end); /* initialize with last element */ while (start != end) { - if (start >= max) { + mask |= (1 << start); + if (++start >= max) { start = 0; } - mask |= (1 << start); - start++; } } return mask;