From 07150cd9286308c893d77cd7748d237544f94225 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Fri, 27 Jan 2023 21:10:02 +0100 Subject: [PATCH] Amend 16e67d4e A docstring is not 0-terminated... --- src/mathed/InsetMathMacro.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index aba4ab79a0..a90bf87f5e 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -991,7 +991,8 @@ void InsetMathMacro::validate(LaTeXFeatures & features) const // Avoid recursion on a recursive macro definition docstring const & def = data->definition(); int pos = tokenPos(def, '\\', name()); - char_type c = def.at(pos + name().size()); + char_type c = pos + name().size() < def.size() + ? def.at(pos + name().size()) : 0; if (pos < 0 || (name().size() > 1 && ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))) { -- 2.39.5