mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Check both lower and upper bound for tainted loop limit
In these cases, the lower bound is not that important, but coverity insists on it.
This commit is contained in:
parent
abc0aaec12
commit
7b0e732eeb
@ -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)
|
||||
|
@ -1375,7 +1375,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|
||||
parse(count, FLAG_ITEM, mode);
|
||||
int cols;
|
||||
// limit arbitrarily to 100 columns
|
||||
if (extractNumber(count, cols) && cols < 100) {
|
||||
if (extractNumber(count, cols) && cols > 0 && cols < 100) {
|
||||
// resize the table if necessary
|
||||
size_t first = grid.index(cellrow, cellcol);
|
||||
for (int i = 1; i < cols; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user