add patch from upstream Ticket #8984 to fix possible out-of-bounds

array access, bump PKGREV
This commit is contained in:
drochner 2011-12-09 16:11:54 +00:00
parent 759c9a66a2
commit 97733d08f6
3 changed files with 28 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.65 2011/07/25 10:16:54 adam Exp $
# $NetBSD: Makefile,v 1.66 2011/12/09 16:11:54 drochner Exp $
DISTNAME= icu4c-4_8_1-src
PKGNAME= icu-4.8.1
PKGREVISION= 1
CATEGORIES= textproc
MASTER_SITES= http://download.icu-project.org/files/icu4c/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tgz

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.21 2011/07/25 10:16:54 adam Exp $
$NetBSD: distinfo,v 1.22 2011/12/09 16:11:54 drochner Exp $
SHA1 (icu4c-4_8_1-src.tgz) = f0252b2b7ad1ef861ac39b177b7a6fcb6c94eb45
RMD160 (icu4c-4_8_1-src.tgz) = 2196dffbc2d074cf56f5dcbb4e2b802c950cfcf0
@ -9,3 +9,4 @@ SHA1 (patch-ac) = e7cee161315321d2580074054d87714b55319886
SHA1 (patch-ad) = f7f20248608e1326359d4464ace32e4ee3031fcb
SHA1 (patch-ae) = c9c62d0bf698ab599351c5c2fc3c2ef4e40aff8e
SHA1 (patch-af) = 924dab672eea2ec80f75f9e095906006e489d900
SHA1 (patch-ag) = 5a1b1e75e1e5387c33a8205233cbfc5f432bbaa1

View file

@ -0,0 +1,24 @@
$NetBSD: patch-ag,v 1.3 2011/12/09 16:11:54 drochner Exp $
Ticket #8984
--- common/uloc.c.orig 2011-07-19 21:16:28.000000000 +0000
+++ common/uloc.c
@@ -1797,7 +1797,7 @@ _canonicalize(const char* localeID,
int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)), variantToCompare, n);
len -= variantLen;
if (variantLen > 0) {
- if (name[len-1] == '_') { /* delete trailing '_' */
+ if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
--len;
}
addKeyword = VARIANT_MAP[j].keyword;
@@ -1805,7 +1805,7 @@ _canonicalize(const char* localeID,
break;
}
}
- if (name[len-1] == '_') { /* delete trailing '_' */
+ if (len > 0 && len <= nameCapacity && name[len-1] == '_') { /* delete trailing '_' */
--len;
}
}