]> git.ipfire.org Git - pakfire.git/commitdiff
key: pakfire_find_key: Check if input is a NULL pointer
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Aug 2021 19:30:59 +0000 (19:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Aug 2021 19:30:59 +0000 (19:30 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/key.c

index e25c78a2110187e0d1f2f0d3c15e05d99209ec8f..8548db452a85b3608b88dc7c276c4e1ff75f435c 100644 (file)
@@ -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;