From: Nikos Mavrogiannopoulos Date: Thu, 1 Mar 2012 15:41:11 +0000 (+0100) Subject: No longer crash on a pkcs11 object without an ID. X-Git-Tag: gnutls_3_0_15~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f14e4cf0507aab359b7aa9f511f94082c7213869;p=thirdparty%2Fgnutls.git No longer crash on a pkcs11 object without an ID. --- diff --git a/NEWS b/NEWS index 02ba4bf12d..db964f78f2 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,9 @@ Reported by Andreas Metzler. ** libgnutls: Corrected rehandshake and resumption operations in DTLS. Reported by Sean Buckheister. +** libgnutls: PKCS #11 objects that do not have ID +no longer crash listing. Reported by Sven Geggus. + ** API and ABI modifications: No changes since last version. diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 40bcb66ee9..fee702384d 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -400,6 +400,12 @@ pkcs11_get_info (struct p11_kit_uri *info, (int)version->minor); terminate = 1; } + else + { + *output_size = 0; + if (output) ((uint8_t*)output)[0] = 0; + return 0; + } if (hexify) {