]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/agetpass.c: Pass "" instead of NULL as an ignored prompt
authorAlejandro Colomar <alx@kernel.org>
Sat, 9 Aug 2025 15:53:26 +0000 (17:53 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 9 Aug 2025 22:13:31 +0000 (17:13 -0500)
This is safer, since in general, readpassphrase(3) does not accept
a null pointer as input.

This was discovered thanks to Chris Bazley's _Optional qualifier, which
I'm testing at the moment.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/agetpass.c

index 36838cc5e7121d1b150046c2a2d0808490d3f0b1..ae735403546c6a9bdbf9dd1f101fb16d8d99619e 100644 (file)
@@ -135,7 +135,7 @@ agetpass(const char *prompt)
 char *
 agetpass_stdin()
 {
-       return agetpass_internal(NULL, RPP_STDIN);
+       return agetpass_internal("", RPP_STDIN);
 }
 
 void