]> git.lyx.org Git - features.git/commitdiff
Limit multirow to 100 columns in mathed
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Mar 2017 09:41:27 +0000 (11:41 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Mar 2017 09:43:12 +0000 (11:43 +0200)
Spotted by coverity, this avoids a blocking loop when parsing.

src/mathed/MathParser.cpp

index ca2eb0f6e5114ef46a33251d6dabd248505aade8..ace167c439608455f732a80db037f7084ec610cc 100644 (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) {