https://github.com/p11-glue/p11-kit/commit/cdc4720d29466e717aa694a85a7aee86ebb94172 From cdc4720d29466e717aa694a85a7aee86ebb94172 Mon Sep 17 00:00:00 2001 From: Erdem Meydanli Date: Thu, 26 Oct 2023 15:18:24 +0000 Subject: [PATCH] fix: improper comparison Compare the return value of the readpassphrase function to NULL. Signed-off-by: Erdem Meydanli --- a/p11-kit/tty.c +++ b/p11-kit/tty.c @@ -66,7 +66,7 @@ p11_pin_tty_callback (const char *pin_source, if (asprintf (&prompt, "%s: ", pin_description) < 0) return NULL; - if (readpassphrase (prompt, buf, sizeof(buf), 0) < 0) + if (readpassphrase (prompt, buf, sizeof(buf), 0) == NULL) goto cleanup; pin = p11_kit_pin_new_for_string (buf);