]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathExtern.cpp
Check both lower and upper bound for tainted loop limit
[features.git] / src / mathed / MathExtern.cpp
index da43bd4e3508043ee7bc6a70801efc90598d470b..182a00971f1b57a90610d7dc71b8f27790751539 100644 (file)
@@ -896,8 +896,8 @@ void extractDiff(MathData & ar)
                                int mult = 1;
                                if (extractNumber(script->up(), mult)) {
                                        //lyxerr << "mult: " << mult << endl;
-                                       if (mult > 1000) {
-                                               lyxerr << "Cannot differentiate more than 1000 times !" << endl;
+                                       if (mult < 0 || mult > 1000) {
+                                               lyxerr << "Cannot differentiate less than 0 or more than 1000 times !" << endl;
                                                continue;
                                        }
                                        for (int i = 0; i < mult; ++i)