commit 6a3ef6a1345dcbd1aa7848f00db26b55e36795b9
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 713e555..5f598b4 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -1478,6 +1478,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") {
diff --git a/status.20x b/status.20x
index bdaeb76..088d3f8 100644
--- a/status.20x
+++ b/status.20x
@@ -52,6 +52,9 @@ What's new
* DOCUMENT INPUT/OUTPUT
+- Do not crash when loading documents with empty (invalid) math environments
+ (part of bug 8359).
+
- Rerun makeindex if all nomencl entries have been removed (bug 8905).
@@ -66,6 +69,9 @@ What's new
- Fix crash when optional argument inside a math macro was deleted (bug 8329).
+- Fix math-ams-matrix function that could corrupt documents if not used
properly
+ (part of bug 8359).
+
- Fix problem that led to assertion in some cases when space was at
beginning of line (bugs 8838 and 8947).