summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/address.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index b43c9bdfe6f0..ae4d48787fe3 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1234,7 +1234,8 @@ static ScRefFlags lcl_ScAddress_Parse_OOo( const sal_Unicode* p, const ScDocumen
// Specified table name is not found in this document. Assume this is an external document.
aDocName = aTab;
sal_Int32 n = aDocName.lastIndexOf('.');
- if (n > 0)
+ // Assume that common filename extensions are not more than 4 characters.
+ if (n > 0 && aTab.getLength() - n <= 4)
{
// Extension found. Strip it.
aTab = aTab.copy(0, n);