Commit c4007c3a authored by Dimitri van Heesch's avatar Dimitri van Heesch

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

parent cb5d8e61
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment