]> andersk Git - openssh.git/blobdiff - auth-pam.c
- (dtucker) [auth-pam.c] Return empty string if fgets fails in
[openssh.git] / auth-pam.c
index bfd8f3270bb13ab2fbbd4fdc22fd948f5ba2da7c..35aecbdb4a70ffbb80e385e2b1c4045d7cbfd457 100644 (file)
@@ -984,7 +984,8 @@ sshpam_tty_conv(int n, sshpam_const struct pam_message **msg,
                        break;
                case PAM_PROMPT_ECHO_ON:
                        fprintf(stderr, "%s\n", PAM_MSG_MEMBER(msg, i, msg));
-                       fgets(input, sizeof input, stdin);
+                       if (fgets(input, sizeof input, stdin) == NULL)
+                               input[0] = '\0';
                        if ((reply[i].resp = strdup(input)) == NULL)
                                goto fail;
                        reply[i].resp_retcode = PAM_SUCCESS;
This page took 0.088494 seconds and 4 git commands to generate.