diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2010-06-12 16:36:46 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2010-06-12 16:36:46 +0000 |
commit | b68dfa402fe1b8e6e81482458e28b8e13fd0cebf (patch) | |
tree | 9c69cf7705288d1620202cef5878090a8e16df1f /dev-libs | |
parent | Delete old patch. (diff) | |
download | gentoo-2-b68dfa402fe1b8e6e81482458e28b8e13fd0cebf.tar.gz gentoo-2-b68dfa402fe1b8e6e81482458e28b8e13fd0cebf.tar.bz2 gentoo-2-b68dfa402fe1b8e6e81482458e28b8e13fd0cebf.zip |
Fix buffer overflow in pkgdata (bug #285735). Add "static-libs" USE flag (bug #319643).
(Portage version: HEAD/cvs/Linux x86_64)
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/icu/ChangeLog | 7 | ||||
-rw-r--r-- | dev-libs/icu/files/icu-4.4.1-pkgdata.patch | 80 | ||||
-rw-r--r-- | dev-libs/icu/icu-4.4.1.ebuild | 17 |
3 files changed, 97 insertions, 7 deletions
diff --git a/dev-libs/icu/ChangeLog b/dev-libs/icu/ChangeLog index 4d77740c3814..1ce643ccf2a8 100644 --- a/dev-libs/icu/ChangeLog +++ b/dev-libs/icu/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-libs/icu # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/ChangeLog,v 1.109 2010/06/05 21:36:14 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/ChangeLog,v 1.110 2010/06/12 16:36:46 arfrever Exp $ + + 12 Jun 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> + icu-4.4.1.ebuild, +files/icu-4.4.1-pkgdata.patch: + Fix buffer overflow in pkgdata (bug #285735). Add "static-libs" USE flag + (bug #319643). 05 Jun 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> icu-4.4.1.ebuild: diff --git a/dev-libs/icu/files/icu-4.4.1-pkgdata.patch b/dev-libs/icu/files/icu-4.4.1-pkgdata.patch new file mode 100644 index 000000000000..8a1a5bc68868 --- /dev/null +++ b/dev-libs/icu/files/icu-4.4.1-pkgdata.patch @@ -0,0 +1,80 @@ +https://bugs.icu-project.org/trac/ticket/7663 +https://bugs.icu-project.org/trac/changeset/28002 +https://bugs.icu-project.org/trac/ticket/7680 +https://bugs.icu-project.org/trac/changeset/28124 + +--- source/tools/pkgdata/pkgdata.cpp ++++ source/tools/pkgdata/pkgdata.cpp +@@ -98,6 +98,7 @@ + #endif + + #define LARGE_BUFFER_MAX_SIZE 2048 ++#define MEDIUM_BUFFER_MAX_SIZE 1024 + #define SMALL_BUFFER_MAX_SIZE 512 + + static void loadLists(UPKGOptions *o, UErrorCode *status); +@@ -472,29 +473,48 @@ + } + + static int runCommand(const char* command, UBool specialHandling) { +- char cmd[SMALL_BUFFER_MAX_SIZE]; ++ char *cmd = NULL; ++ char cmdBuffer[SMALL_BUFFER_MAX_SIZE]; ++ int32_t len = strlen(command); ++ ++ if (len == 0) { ++ return 0; ++ } + + if (!specialHandling) { ++#if defined(USING_CYGWIN) || defined(OS400) ++#define CMD_PADDING_SIZE 20 ++ if ((len + CMD_PADDING_SIZE) >= SMALL_BUFFER_MAX_SIZE) { ++ cmd = (char *)uprv_malloc(len + CMD_PADDING_SIZE); ++ } else { ++ cmd = cmdBuffer; ++ } + #ifdef USING_CYGWIN + sprintf(cmd, "bash -c \"%s\"", command); + + #elif defined(OS400) + sprintf(cmd, "QSH CMD('%s')", command); ++#endif + #else + goto normal_command_mode; + #endif + } else { + normal_command_mode: +- sprintf(cmd, "%s", command); ++ cmd = (char *)command; + } +- ++ + printf("pkgdata: %s\n", cmd); + int result = system(cmd); +- if (result != 0) { +- printf("-- return status = %d\n", result); ++ if (result != 0) { ++ printf("-- return status = %d\n", result); + } +- return result; +-} ++ ++ if (cmd != cmdBuffer && cmd != command) { ++ uprv_free(cmd); ++ } ++ ++ return result; ++} + + #define LN_CMD "ln -s" + #define RM_CMD "rm -f" +@@ -586,7 +606,7 @@ + pkgDataFlags = (char**)uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE); + if (pkgDataFlags != NULL) { + for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) { +- pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * SMALL_BUFFER_MAX_SIZE); ++ pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * MEDIUM_BUFFER_MAX_SIZE); + if (pkgDataFlags[i] != NULL) { + pkgDataFlags[i][0] = 0; + } else { diff --git a/dev-libs/icu/icu-4.4.1.ebuild b/dev-libs/icu/icu-4.4.1.ebuild index a6dc8a7af184..d80313e87a6a 100644 --- a/dev-libs/icu/icu-4.4.1.ebuild +++ b/dev-libs/icu/icu-4.4.1.ebuild @@ -1,12 +1,13 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/icu-4.4.1.ebuild,v 1.3 2010/06/05 21:36:14 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/icu/icu-4.4.1.ebuild,v 1.4 2010/06/12 16:36:46 arfrever Exp $ EAPI="3" -inherit flag-o-matic versionator +inherit eutils flag-o-matic versionator MAJOR_MINOR_VERSION="$(get_version_component_range 1-2)" +MICRO_VERSION="$(get_version_component_range 3)" DESCRIPTION="International Components for Unicode" HOMEPAGE="http://www.icu-project.org/" @@ -22,14 +23,14 @@ SRC_URI="${BASE_URI}/${SRC_ARCHIVE} LICENSE="BSD" SLOT="0" KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd" -IUSE="debug doc examples" +IUSE="debug doc examples static-libs" DEPEND="doc? ( app-arch/unzip )" RDEPEND="" S="${WORKDIR}/${PN}/source" -QA_DT_NEEDED="/usr/lib.*/libicudata.so.${MAJOR_MINOR_VERSION/./}.0" +QA_DT_NEEDED="/usr/lib.*/libicudata.so.${MAJOR_MINOR_VERSION/./}.${MICRO_VERSION:-0}" src_unpack() { unpack "${SRC_ARCHIVE}" @@ -48,13 +49,17 @@ src_prepare() { for x in ARFLAGS CFLAGS CPPFLAGS CXXFLAGS FFLAGS LDFLAGS; do sed -i -e "/^${x} =.*/s:@${x}@::" "config/Makefile.inc.in" || die "sed failed" done + + epatch "${FILESDIR}/${P}-pkgdata.patch" } src_configure() { + append-flags -fno-strict-aliasing + econf \ - --enable-static \ $(use_enable debug) \ - $(use_enable examples samples) + $(use_enable examples samples) \ + $(use_enable static-libs static) } src_test() { |