commit 31cd421bcd26647cb7edbb694b05473271fe9153
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Tue Mar 28 11:41:27 2017 +0200

    Limit multirow to 100 columns in mathed
    
    Spotted by coverity, this avoids a blocking loop when parsing.
---
 src/mathed/MathParser.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index ca2eb0f..ace167c 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) {

Reply via email to