From: Pat Thoyts Date: Wed, 29 Sep 2010 22:22:32 GMT Subject: [PATCH 1/2] Make sure that git_getpass() never returns NULL Message-ID: <1285798953-15320-2-git-send-email-patthoyts@users.sourceforge.net> In-Reply-To: <7vocbhsn03.fsf@alter.siamese.dyndns.org> From: Johannes Schindelin 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 --- connect.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/connect.c b/connect.c index 3450cab..57dc20c 100644 --- a/connect.c +++ b/connect.c @@ -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; -- 1.7.3