[Libreoffice-commits] core.git: sal/textenc

Markus Mohrhard markus.mohrhard at googlemail.com
Mon May 5 05:36:57 PDT 2014


 sal/textenc/handleundefinedunicodetotextchar.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 51bfb3a5af91dcd17ebc4c52845e77f530f05c6d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon May 5 02:29:55 2014 +0200

    Asan: fix invalid memory access
    
    Change-Id: I7a2acd99f3a8cb143c2ad1c978dfa4b02bf54464
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sal/textenc/handleundefinedunicodetotextchar.cxx b/sal/textenc/handleundefinedunicodetotextchar.cxx
index 6ea1dad..7ff7bd0 100644
--- a/sal/textenc/handleundefinedunicodetotextchar.cxx
+++ b/sal/textenc/handleundefinedunicodetotextchar.cxx
@@ -108,7 +108,7 @@ bool sal::detail::textenc::handleUndefinedUnicodeToTextChar(
     /* one replacement character */
     if (ImplIsHighSurrogate(c))
     {
-        if ( *ppSrcBuf == pEndSrcBuf )
+        if ( ((*ppSrcBuf) + 1) == pEndSrcBuf )
         {
             *pInfo |= RTL_UNICODETOTEXT_INFO_ERROR | RTL_UNICODETOTEXT_INFO_SRCBUFFERTOSMALL;
             return false;


More information about the Libreoffice-commits mailing list