]> git.lyx.org Git - features.git/commitdiff
Fix a crash with uninitialized buffer member of MathData
authorStephan Witt <switt@lyx.org>
Sat, 8 Feb 2020 15:33:51 +0000 (16:33 +0100)
committerStephan Witt <switt@lyx.org>
Sat, 8 Feb 2020 15:33:51 +0000 (16:33 +0100)
See the details here: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210294.html

src/mathed/InsetMathNest.cpp
status.23x

index bc3c2add0eadbf963aa66a0b140c4156d7f10d16..db03dabcafa3f65423c736b089c63b7511eef856 100644 (file)
@@ -1232,10 +1232,12 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.recordUndoSelection();
                if (cmd.argument() == "^" || cmd.argument() == "_")
                        interpretChar(cur, cmd.argument()[0]);
+               else if (!cur.selection())
+                       cur.niceInsert(cmd.argument());
                else {
-                       MathData ar;
+                       MathData ar(cur.buffer());
                        asArray(cmd.argument(), ar);
-                       if (cur.selection() && ar.size() == 1
+                       if (ar.size() == 1
                            && ar[0]->asNestInset()
                            && ar[0]->asNestInset()->nargs() > 1)
                                handleNest(cur, ar[0]);
index f93844e61e5ab156354bc33a25a1c3f60aac4021..147b17bad7f53a9c5fb9c35c2d50672d12412b4a 100644 (file)
@@ -53,7 +53,6 @@ What's new
 
 - Correctly strike out deleted text after deleted display math (bug 11716).
 
-
 * USER INTERFACE
 
 - Fix backspace deletion of selected items with change tracking (bug 11630).
@@ -65,6 +64,9 @@ What's new
 
 - Properly resize columns of child document table widget.
 
+- Fix a crash reported on lyx users.
+  There was an uninitialized buffer member of MathData in LFUN dispatch.
+
 
 * INTERNALS