Skip to content

Commit

Permalink
fix: improper comparison
Browse files Browse the repository at this point in the history
Compare the return value of the readpassphrase function to NULL.

Signed-off-by: Erdem Meydanli <[email protected]>
  • Loading branch information
meerd authored and ueno committed Oct 26, 2023
1 parent 8e21f76 commit cdc4720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p11-kit/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cdc4720

Please sign in to comment.