eventattacher: fix out of bounds string access

Change-Id: Ic1f7ac2b6c3f5a865b316a83d92a0f2ff7616f5c
This commit is contained in:
Miklos Vajna 2014-02-27 12:22:36 +01:00
parent 44c90b3d75
commit 9fd15d9e37

View File

@ -624,7 +624,7 @@ Reference<XEventListener> EventAttacherImpl::attachListenerForTarget(
else
nIndex++;
OUString aListenerName = (aListenerType[nIndex] == 'X') ? aListenerType.copy(nIndex+1) : aListenerType;
OUString aListenerName = (!aListenerType.isEmpty() && aListenerType[nIndex] == 'X') ? aListenerType.copy(nIndex+1) : aListenerType;
OUString aAddListenerName = "add" + aListenerName;
// Send Methods to the correct addListener-Method