From 1548d82560b242579f5ba216b66bd59ccd0f3fd0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Jul 2013 18:55:38 +0200 Subject: Don't call memdup with zero length or NULL pointer https://bugzilla.redhat.com/show_bug.cgi?id=985433 --- p11-kit/pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p11-kit') diff --git a/p11-kit/pin.c b/p11-kit/pin.c index 60571de..2fca6bc 100644 --- a/p11-kit/pin.c +++ b/p11-kit/pin.c @@ -357,7 +357,7 @@ p11_kit_pin_request (const char *pin_source, if (callbacks == NULL) callbacks = p11_dict_get (gl.pin_sources, P11_KIT_PIN_FALLBACK); - if (callbacks != NULL) { + if (callbacks != NULL && callbacks->num) { snapshot = memdup (callbacks->elem, sizeof (void *) * callbacks->num); snapshot_count = callbacks->num; for (i = 0; snapshot && i < snapshot_count; i++) -- cgit v1.1