https://bugs.freedesktop.org/show_bug.cgi?id=62090

--- Comment #6 from Julien Nabet <[email protected]> ---
Noel, what about this patch? I tested it for this case and it works but perhaps
I forgot something.

diff --git a/basic/source/runtime/methods.cxx
b/basic/source/runtime/methods.cxx
index 5dc45ed..12dfff2 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1266,7 +1266,7 @@ RTLFUNC(Mid)
                 {
                     aResultStr = aArgStr;
                     aResultStr.remove( nStartPos, nLen );
-                    aResultStr.insert( nStartPos,
rPar.Get(4)->GetOUString().getStr(), nLen);
+                    aResultStr.insert( nStartPos,
rPar.Get(4)->GetOUString().getStr(), std::min(nLen,
rPar.Get(4)->GetOUString().getLength()));
                 }

                 rPar.Get(1)->PutString( aResultStr.makeStringAndClear() );

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to