From: Enrico Forestieri Date: Fri, 27 Jan 2023 20:10:02 +0000 (+0100) Subject: Amend 16e67d4e X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=07150cd9286308c893d77cd7748d237544f94225;p=features.git Amend 16e67d4e A docstring is not 0-terminated... --- 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')))) {