summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-10-17 23:22:28 +1100
committerDamien Miller <djm@mindrot.org>2000-10-17 23:22:28 +1100
commit2594de81d301188108c1accbd4f937a86d70db1c (patch)
tree24b247fe333aa478af9a70da7a7a339d95b2ed7d /ssh-add.c
parentef767acfb7b5f379739802aacd22ff0abbb8c810 (diff)
- (djm) Don't rely on atomicio's retval to determine length of askpass
supplied passphrase. Problem report from Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssh-add.c b/ssh-add.c
index efbf771d..3adc2509 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -117,7 +117,9 @@ ssh_askpass(char *askpass, char *msg)
fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno));
}
close(p[1]);
- len = atomicio(read, p[0], buf, sizeof buf);
+ buf[0] = '\0';
+ atomicio(read, p[0], buf, sizeof buf);
+ len = strlen(buf);
close(p[0]);
while (waitpid(pid, &status, 0) < 0)
if (errno != EINTR)