From 5a3797643c7e635fcf5b73b92648aeeb606e9b97 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Thu, 14 May 2009 16:22:14 +0000 Subject: [PATCH] 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 --- main/pbx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;