diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-05-10 14:41:12 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-05-26 14:16:24 +0000 |
commit | ed22a255ac22d056bade9e7b3da6333dcc0d5c2d (patch) | |
tree | 06fbcec92b9bf6ce1761d0d873feb0909f09c10e /main | |
parent | 878a7a8ce20fefa96d991a7f3744b433ca1bbba2 (diff) | |
download | aports-ed22a255ac22d056bade9e7b3da6333dcc0d5c2d.tar.bz2 aports-ed22a255ac22d056bade9e7b3da6333dcc0d5c2d.tar.xz |
main/apk-tools: fix segfault for apk info
ref #345
Diffstat (limited to 'main')
-rw-r--r-- | main/apk-tools/APKBUILD | 11 | ||||
-rw-r--r-- | main/apk-tools/info-segfault.patch | 22 |
2 files changed, 30 insertions, 3 deletions
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index 7b36613784..65b299d94f 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,26 +1,30 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=apk-tools pkgver=2.0.2 -pkgrel=0 +pkgrel=1 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= makedepends="zlib-dev openssl-dev pkgconfig" source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 + info-segfault.patch " url="http://git.alpinelinux.org/cgit/apk-tools/" license=GPL-2 -build() { +prepare() { cd "$srcdir/$pkgname-$pkgver" sed -i -e 's:-Werror::' Make.rules for i in ../*.patch; do [ -f $i ] || continue patch -p1 -i $i || return 1 done +} +build() { + cd "$srcdir/$pkgname-$pkgver" make || return 1 make static || return 1 make DESTDIR="$pkgdir" install @@ -40,4 +44,5 @@ static() { "$subpkgdir"/sbin/apk.static } -md5sums="c87cb88f90eb8d7021d37e3b5386863d apk-tools-2.0.2.tar.bz2" +md5sums="c87cb88f90eb8d7021d37e3b5386863d apk-tools-2.0.2.tar.bz2 +aeab86a00119f9945edd6d3c3a8bb9c1 info-segfault.patch" diff --git a/main/apk-tools/info-segfault.patch b/main/apk-tools/info-segfault.patch new file mode 100644 index 0000000000..9479fade30 --- /dev/null +++ b/main/apk-tools/info-segfault.patch @@ -0,0 +1,22 @@ +commit 87420aaf295f58847332ba3aa89691a0259baace +Author: Timo Teras <timo.teras@iki.fi> +Date: Wed May 5 08:56:06 2010 +0300 + + info: fix querying of removed, but referenced packages + + Check that package name has packages associated with it before + dereferencing the pointer. Fixes #345. + +diff --git a/src/info.c b/src/info.c +index 7ca486c..d944fca 100644 +--- a/src/info.c ++++ b/src/info.c +@@ -283,7 +283,7 @@ static int info_package(struct info_ctx *ctx, struct apk_database *db, + + for (i = 0; i < argc; i++) { + name = apk_db_query_name(db, APK_BLOB_STR(argv[i])); +- if (name == NULL) { ++ if (name == NULL || name->pkgs == NULL) { + apk_error("Not found: %s", argv[i]); + return 1; + } |