summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Perry2019-02-02 14:10:20 +0000
committerKevin Perry2019-02-02 14:10:20 +0000
commitc8b500e4d06fd176b12dc244929c0bdd640e7329 (patch)
tree8e3e14a83ba8705aca8fe52224ae0ead2943cce8
parent4b7d76abf761fd3e318de1bb2904193314a55d87 (diff)
downloadaur-c8b500e4d06fd176b12dc244929c0bdd640e7329.tar.gz
Add patch for fixing a NULL check
-rw-r--r--PKGBUILD11
-rw-r--r--icu-positionNULLcheck.patch12
2 files changed, 20 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0a7f3277fb6b..798ac798cd71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,7 +10,7 @@ _libdir='/usr/lib'
pkgname=${_pkgbase}${_pkgmajor}
pkgver=${_pkgmajor}.${_pkgminor}.${_pkgpatch}
-pkgrel=1
+pkgrel=2
pkgdesc='International Components for Unicode library'
url='http://site.icu-project.org/'
license=('custom:icu')
@@ -19,10 +19,12 @@ arch=('i686' 'x86_64')
depends=('gcc-libs>=4.7.1-5' 'sh')
source=("http://download.icu-project.org/files/${_pkgbase}4c/${pkgver}/${_pkgbase}4c-${pkgver//./_}-src.tgz"
'icu.8198.revert.icu5431.patch'
- 'icu-testtwodigityear.patch')
+ 'icu-testtwodigityear.patch'
+ 'icu-positionNULLcheck.patch')
md5sums=('beb98aa972219c9fcd9c8a71314943c9'
'ebd5470fc969c75e52baf4af94a9ee82'
- '8d14652aee347adba25886cd14af1637')
+ '8d14652aee347adba25886cd14af1637'
+ 'c2ead5292460c386818d75b2b6a69a5f')
prepare() {
cd ${srcdir}/${_pkgbase}/source
@@ -34,6 +36,9 @@ prepare() {
# patch taken from CentOS 7 source package
# http://vault.centos.org/7.2.1511/os/Source/SPackages/icu-50.1.2-15.el7.src.rpm
patch -p2 -i ${srcdir}/icu-testtwodigityear.patch
+
+ # fix position pointer being checked against > 0
+ patch -p2 -i ${srcdir}/icu-positionNULLcheck.patch
}
build() {
diff --git a/icu-positionNULLcheck.patch b/icu-positionNULLcheck.patch
new file mode 100644
index 000000000000..86d33e9dc3b8
--- /dev/null
+++ b/icu-positionNULLcheck.patch
@@ -0,0 +1,12 @@
+diff -ru icu.orig/source/i18n/uspoof.cpp icu/source/i18n/uspoof.cpp
+--- icu.orig/source/i18n/uspoof.cpp 2013-01-11 00:22:42.000000000 +0000
++++ icu/source/i18n/uspoof.cpp 2019-02-02 13:55:41.791638667 +0000
+@@ -369,7 +369,7 @@
+ // u_strToUTF8() in preflight mode is an easy way to do it.
+ U_ASSERT(position16 <= len16);
+ u_strToUTF8(NULL, 0, position, text16, position16, status);
+- if (position > 0) {
++ if (position != NULL) {
+ // position is the required buffer length from u_strToUTF8, which includes
+ // space for a terminating NULL, which we don't want, hence the -1.
+ *position -= 1;