diff options
author | crees <crees@FreeBSD.org> | 2011-12-23 22:54:18 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-12-23 22:54:18 +0800 |
commit | 47d57c7c3b5c77ffc9835ee966b7b3f3c96672a2 (patch) | |
tree | 370028c78c7d093a27fb6c73e20fb7092df17479 /devel | |
parent | dc37a32b283a0cb755cb34ebcc65bb036bd8f6c7 (diff) | |
download | freebsd-ports-gnome-47d57c7c3b5c77ffc9835ee966b7b3f3c96672a2.tar.gz freebsd-ports-gnome-47d57c7c3b5c77ffc9835ee966b7b3f3c96672a2.tar.zst freebsd-ports-gnome-47d57c7c3b5c77ffc9835ee966b7b3f3c96672a2.zip |
Fix potential out of bounds access in _canonicalize devel/icu
Not sure this is worth a VuXML, but one will be made on request
PR: ports/163476
Submitted by: Andrei Lavreniyuk <andy.lavr@gmail.com>
Obtained from: http://bugs.icu-project.org/trac/ticket/8984
Diffstat (limited to 'devel')
-rw-r--r-- | devel/icu/Makefile | 1 | ||||
-rw-r--r-- | devel/icu/files/patch-common-uloc.c | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/devel/icu/Makefile b/devel/icu/Makefile index 8d41cd0f17c8..1f467690c62f 100644 --- a/devel/icu/Makefile +++ b/devel/icu/Makefile @@ -7,6 +7,7 @@ PORTNAME= icu PORTVERSION= 4.8.1.1 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://download.icu-project.org/files/icu4c/${PORTVERSION}/ \ SF/${PORTNAME}/ICU4C/${PORTVERSION}/ diff --git a/devel/icu/files/patch-common-uloc.c b/devel/icu/files/patch-common-uloc.c new file mode 100644 index 000000000000..0886b44dd7f7 --- /dev/null +++ b/devel/icu/files/patch-common-uloc.c @@ -0,0 +1,26 @@ +$FreeBSD$ + +From http://bugs.icu-project.org/trac/ticket/8984 + +Submitted by: Andrei Lavreniyuk <andy.lavr@gmail.com> (thanks!) + +--- common/uloc.c ++++ common/uloc.c +@@ -1797,7 +1797,7 @@ + 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 @@ + break; + } + } +- if (name[len-1] == '_') { /* delete trailing '_' */ ++ if (len > 0 && len <= nameCapacity && name[len-1] == '_') { /* delete trailing '_' */ + --len; + } + } |