diff --git a/srcpkgs/netpgp/patches/keyring_crash.patch b/srcpkgs/netpgp/patches/keyring_crash.patch new file mode 100644 index 00000000000..5e8407b1fef --- /dev/null +++ b/srcpkgs/netpgp/patches/keyring_crash.patch @@ -0,0 +1,21 @@ +$NetBSD: patch-src_lib_keyring.c,v 1.1 2017/02/20 01:09:11 khorben Exp $ + +Do not crash when listing keys without a keyring + +--- src/lib/keyring.c.orig 2017-02-20 01:03:25.000000000 +0000 ++++ src/lib/keyring.c +@@ -993,9 +993,12 @@ pgp_keyring_list(pgp_io_t *io, const pgp + { + pgp_key_t *key; + unsigned n; ++ unsigned keyc = (keyring != NULL) ? keyring->keyc : 0; + +- (void) fprintf(io->res, "%u key%s\n", keyring->keyc, +- (keyring->keyc == 1) ? "" : "s"); ++ (void) fprintf(io->res, "%u key%s\n", keyc, (keyc == 1) ? "" : "s"); ++ if (keyring == NULL) { ++ return 1; ++ } + for (n = 0, key = keyring->keys; n < keyring->keyc; ++n, ++key) { + if (pgp_is_key_secret(key)) { + pgp_print_keydata(io, keyring, key, "sec", diff --git a/srcpkgs/netpgp/template b/srcpkgs/netpgp/template index 2053bac8ae3..a28a576803c 100644 --- a/srcpkgs/netpgp/template +++ b/srcpkgs/netpgp/template @@ -1,7 +1,7 @@ # Template file for 'netpgp' pkgname=netpgp version=20140220 -revision=10 +revision=11 build_style=gnu-configure hostmakedepends="automake libtool pkg-config" makedepends="zlib-devel bzip2-devel libressl-devel" @@ -17,6 +17,11 @@ CFLAGS="-Wno-error=cpp" pre_configure() { autoreconf -fi } +do_check() { + # depends on the netpgpverify package which depends on libnetpgp + # from this package + : +} post_install() { vlicense Licence LICENSE }