Permalink
Browse files

Bug 735499 - [PATCH] Fix potential modulo by zero in src/template.cpp

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Aug 30, 2014
1 parent cb5d8e6 commit c4007c3abea9c8494bf32181a1352b5366bede69
Showing with 9 additions and 1 deletion.
  1. +9 −1 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
{

0 comments on commit c4007c3

Please sign in to comment.