From 6e7bfc896e6cb4d91dcecf974f0d9ee41f35b86a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 8 Apr 2019 15:21:09 +0100 Subject: ofz#14129 assert on empty string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9ef3ef21111b3b853df43b2f84bfd7e5da824682 Reviewed-on: https://gerrit.libreoffice.org/70419 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/qa/unit/data/wks/fail/ofz14129-1.wks | Bin 0 -> 52 bytes sc/source/filter/lotus/tool.cxx | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 sc/qa/unit/data/wks/fail/ofz14129-1.wks (limited to 'sc') diff --git a/sc/qa/unit/data/wks/fail/ofz14129-1.wks b/sc/qa/unit/data/wks/fail/ofz14129-1.wks new file mode 100644 index 000000000000..016d87e63a86 Binary files /dev/null and b/sc/qa/unit/data/wks/fail/ofz14129-1.wks differ diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index dabbd05dcd03..2c0a0f7465e9 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -480,9 +480,10 @@ bool RangeNameBufferWK3::FindRel( const OUString& rRef, sal_uInt16& rIndex ) bool RangeNameBufferWK3::FindAbs( const OUString& rRef, sal_uInt16& rIndex ) { - OUString aTmp( rRef ); - aTmp = aTmp.copy(1); - StringHashEntry aRef( aTmp ); // search w/o '$'! + if (rRef.isEmpty()) + return false; + OUString aTmp(rRef.copy(1)); + StringHashEntry aRef(aTmp); // search w/o '$'! std::vector::iterator itr = std::find_if(maEntries.begin(), maEntries.end(), [&aRef](const Entry& rEntry) { return aRef == rEntry.aStrHashEntry; }); -- cgit v1.2.3