From: Juergen Spitzmueller Date: Mon, 10 Feb 2014 08:24:14 +0000 (+0100) Subject: Do not crash with empty (invalid) math environments (part of #8359) X-Git-Tag: 2.1.0rc1~237 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8b1504d7ade5c8b742bf9cdf7bde7fe0619cf678;p=features.git Do not crash with empty (invalid) math environments (part of #8359) --- diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 05ceed80f2..ef987789b3 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") {