From c7eeb5502fe030fd75229eec2c05427f3df374c6 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 1 Mar 2012 16:39:25 +0100 Subject: [PATCH] No longer crash on a pkcs11 object without an ID. --- NEWS | 3 +++ lib/pkcs11.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 41c0c5046..a5c56c845 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,9 @@ Version 2.12.17 (unreleased) ** libgnutls: Corrections in record packet parsing. Reported by Matthew Hall. +** 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 83fad64b8..f4f64f702 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -396,6 +396,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) { -- 2.11.4.GIT