From: Jean-Marc Lasgouttes Date: Tue, 28 Mar 2017 09:41:27 +0000 (+0200) Subject: Limit multirow to 100 columns in mathed X-Git-Tag: 2.3.0alpha1~159 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=31cd421bcd26647cb7edbb694b05473271fe9153;p=features.git Limit multirow to 100 columns in mathed Spotted by coverity, this avoids a blocking loop when parsing. --- diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index ca2eb0f6e5..ace167c439 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -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) {