From 8b1504d7ade5c8b742bf9cdf7bde7fe0619cf678 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 +++++++ 1 file changed, 7 insertions(+) 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") { -- 2.39.2