From: Michael Tremer Date: Sat, 7 Aug 2021 19:30:59 +0000 (+0000) Subject: key: pakfire_find_key: Check if input is a NULL pointer X-Git-Tag: 0.9.28~1004 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=199bea8205e68b8f3a3fde6cbbcad5d96fdfaaf2;p=pakfire.git key: pakfire_find_key: Check if input is a NULL pointer Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/key.c b/src/libpakfire/key.c index e25c78a21..8548db452 100644 --- a/src/libpakfire/key.c +++ b/src/libpakfire/key.c @@ -209,6 +209,11 @@ PAKFIRE_EXPORT void pakfire_key_unref(struct pakfire_key* key) { } static int pakfire_find_key(struct pakfire_key** key, struct pakfire* pakfire, const char* fingerprint) { + if (!fingerprint) { + errno = EINVAL; + return 1; + } + // Reset key *key = NULL;