commit 8b1504d7ade5c8b742bf9cdf7bde7fe0619cf678
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Feb 10 09:24:14 2014 +0100

    Do not crash with empty (invalid) math environments (part of #8359)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index 05ceed8..ef98778 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -1528,6 +1528,13 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 
                else if (t.cs() == "begin") {
                        docstring const name = getArg('{', '}');
+                       
+                       if (name.empty()) {
+                               success_ = false;
+                               error("found invalid environment");
+                               return success_;
+                       }
+                       
                        environments_.push_back(name);
 
                        if (name == "array" || name == "subarray") {

Reply via email to