diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2010-09-29 23:22:32 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-30 12:22:02 -0700 |
commit | 8713feb16dd6a472828bbdcf914a1c8f5c6810a2 (patch) | |
tree | 465aa54197d8f87734170e05e767fc20d7a9630c /connect.c | |
parent | dbda967684dfefd0ac3518f9805ccf9ded9af429 (diff) | |
download | git-8713feb16dd6a472828bbdcf914a1c8f5c6810a2.tar.gz |
Make sure that git_getpass() never returns NULL
The result of git_getpass() is used without checking for NULL, so let's
just die() instead of returning NULL.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r-- | connect.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -631,8 +631,12 @@ char *git_getpass(const char *prompt) askpass = askpass_program; if (!askpass) askpass = getenv("SSH_ASKPASS"); - if (!askpass || !(*askpass)) - return getpass(prompt); + if (!askpass || !(*askpass)) { + char *result = getpass(prompt); + if (!result) + die_errno("Could not read password"); + return result; + } args[0] = askpass; args[1] = prompt; |