From: Tilghman Lesher Date: Thu, 21 Jan 2010 05:54:30 +0000 (+0000) Subject: Merged revisions 241765 via svnmerge from X-Git-Tag: 11.0.0-beta1~3556 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44a9aab93af69ca17fd7d74281fcf6fd5f942fdb;p=thirdparty%2Fasterisk.git Merged revisions 241765 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r241765 | tilghman | 2010-01-20 23:53:17 -0600 (Wed, 20 Jan 2010) | 2 lines Guard against division by zero. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241766 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_math.c b/funcs/func_math.c index ab174d9440..761c632281 100644 --- a/funcs/func_math.c +++ b/funcs/func_math.c @@ -289,7 +289,11 @@ static int math(struct ast_channel *chan, const char *cmd, char *parse, int inum1 = fnum1; int inum2 = fnum2; - ftmp = (inum1 % inum2); + if (inum2 == 0) { + ftmp = 0; + } else { + ftmp = (inum1 % inum2); + } break; }