summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-26 09:38:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-26 09:47:59 +0100
commitac35f0e1cc6166005f6bbd3ab8aecbc4e9745bc2 (patch)
tree1b0118cb4e6732b0ba877e2e95291954797d2569 /i18npool
parent8d01d16c4bc2531a37dca54526568fd5b533a40f (diff)
coverity#1241051 Negative array index read
Change-Id: I958267c88f74523a5aaba0ff6c677aadd2e84dd9
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 9a5455df1cee..8520a689cb0d 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -687,8 +687,11 @@ NativeNumberXmlAttributes SAL_CALL NativeNumberSupplierService::convertToXmlAttr
sal_Int16 number = NumberChar_HalfWidth, type = attShort;
+ sal_Int16 langnum = -1;
if (isValidNatNum(rLocale, nNativeNumberMode)) {
- sal_Int16 langnum = getLanguageNumber(rLocale);
+ langnum = getLanguageNumber(rLocale);
+ }
+ if (langnum != -1) {
switch (nNativeNumberMode) {
case NativeNumberMode::NATNUM0: // Ascii
number = NumberChar_HalfWidth;