Limit multirow to 100 columns in mathed

Spotted by coverity, this avoids a blocking loop when parsing.
This commit is contained in:
Jean-Marc Lasgouttes 2017-03-28 11:41:27 +02:00
parent 4488c45d09
commit 31cd421bcd

View File

@ -1374,7 +1374,8 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
MathData count;
parse(count, FLAG_ITEM, mode);
int cols;
if (extractNumber(count, cols)) {
// limit arbitrarily to 100 columns
if (extractNumber(count, cols) && cols < 100) {
// resize the table if necessary
size_t first = grid.index(cellrow, cellcol);
for (int i = 1; i < cols; ++i) {