summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-03-01 16:39:25 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-03-01 16:39:25 +0100
commitc7eeb5502fe030fd75229eec2c05427f3df374c6 (patch)
tree2e47c586ff64374061de337350b294c3aace7958
parent422214868061370aeeb0ac9cd0f021a5c350a57d (diff)
downloadgnutls-c7eeb5502fe030fd75229eec2c05427f3df374c6.tar.gz
No longer crash on a pkcs11 object without an ID.
-rw-r--r--NEWS3
-rw-r--r--lib/pkcs11.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 41c0c50467..a5c56c8451 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 83fad64b89..f4f64f702b 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)
{