bump product version to 4.1.6.2
[LibreOffice.git] / icu / icu4c.10318.CVE-2013-2924_changeset_34076.patch
blob90f50ab0318fc975f4f7fd63528adb28562278bb
1 Index: /icu/trunk/source/i18n/csrucode.cpp
2 ===================================================================
3 --- a/orig.icu/source/i18n/csrucode.cpp (revision 34075)
4 +++ b/icu/source/i18n/csrucode.cpp (revision 34076)
5 @@ -1,5 +1,5 @@
6 /*
7 **********************************************************************
8 - * Copyright (C) 2005-2012, International Business Machines
9 + * Copyright (C) 2005-2013, International Business Machines
10 * Corporation and others. All Rights Reserved.
11 **********************************************************************
12 @@ -34,6 +34,7 @@
13 const uint8_t *input = textIn->fRawInput;
14 int32_t confidence = 0;
15 + int32_t length = textIn->fRawLength;
17 - if (input[0] == 0xFE && input[1] == 0xFF) {
18 + if (length >=2 && input[0] == 0xFE && input[1] == 0xFF) {
19 confidence = 100;
21 @@ -58,6 +59,7 @@
22 const uint8_t *input = textIn->fRawInput;
23 int32_t confidence = 0;
24 + int32_t length = textIn->fRawLength;
26 - if (input[0] == 0xFF && input[1] == 0xFE && (input[2] != 0x00 || input[3] != 0x00)) {
27 + if (length >= 4 && input[0] == 0xFF && input[1] == 0xFE && (input[2] != 0x00 || input[3] != 0x00)) {
28 confidence = 100;
30 @@ -82,5 +84,5 @@
31 int32_t confidence = 0;
33 - if (getChar(input, 0) == 0x0000FEFFUL) {
34 + if (limit > 0 && getChar(input, 0) == 0x0000FEFFUL) {
35 hasBOM = TRUE;