From 614e04019a672cdd61b86699d99250d80f169f95 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 6 Nov 2013 17:37:42 +0100 Subject: [PATCH] codemaker: fix invalid string index access Change-Id: Icca819484e751864d146a893fe78e8ef2c36363b --- codemaker/source/codemaker/global.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index d6c5a0fae942..ba3f42484d5a 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -87,8 +87,9 @@ OString createFileNameFromType( const OString& destination, length += prefix.getLength() + type.getLength() + postfix.getLength(); sal_Bool withSeparator = sal_False; - if (destination[destination.getLength()] != '\\' && - destination[destination.getLength()] != '/' && + if (!destination.isEmpty() && + destination[destination.getLength() - 1] != '\\' && + destination[destination.getLength() - 1] != '/' && type[0] != '\\' && type[0] != '/') {