From 6a3ef6a1345dcbd1aa7848f00db26b55e36795b9 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 10 Feb 2014 09:24:14 +0100 Subject: [PATCH] Do not crash with empty (invalid) math environments (part of #8359) --- src/mathed/MathParser.cpp | 7 +++++++ status.20x | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 713e5554b5..5f598b469f 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 bdaeb76692..088d3f888c 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).