summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-05 02:29:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-05 14:36:28 +0200
commit51bfb3a5af91dcd17ebc4c52845e77f530f05c6d (patch)
treed420dfed8d23594241ab5319219666c203305183
parent315503314aaeed11d1e25d5a379d56fd3051dba0 (diff)
Asan: fix invalid memory access
Change-Id: I7a2acd99f3a8cb143c2ad1c978dfa4b02bf54464 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sal/textenc/handleundefinedunicodetotextchar.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sal/textenc/handleundefinedunicodetotextchar.cxx b/sal/textenc/handleundefinedunicodetotextchar.cxx
index 6ea1dad81dac..7ff7bd0924a9 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;