diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-30 17:25:21 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-30 17:25:21 (GMT) |
commit | c4007c3abea9c8494bf32181a1352b5366bede69 (patch) | |
tree | ab90f7e359d76252efaec0b04a7bc42b5b1e15e9 /src | |
parent | cb5d8e6198fe0d0852fb06d6fa18b8ae2682e2c0 (diff) | |
download | Doxygen-c4007c3abea9c8494bf32181a1352b5366bede69.zip Doxygen-c4007c3abea9c8494bf32181a1352b5366bede69.tar.gz Doxygen-c4007c3abea9c8494bf32181a1352b5366bede69.tar.bz2 |
Bug 735499 - [PATCH] Fix potential modulo by zero in src/template.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/template.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/template.cpp b/src/template.cpp index ec8554b..cec2e3c 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -1319,7 +1319,15 @@ class FilterDivisibleBy } if (v.type()==TemplateVariant::Integer && n.type()==TemplateVariant::Integer) { - return TemplateVariant((v.toInt()%n.toInt())==0); + int ni = n.toInt(); + if (ni>0) + { + return TemplateVariant((v.toInt()%ni)==0); + } + else + { + return TemplateVariant(FALSE); + } } else { |