From: Johannes Schindelin Date: Wed, 29 Sep 2010 22:22:32 +0000 (+0100) Subject: Make sure that git_getpass() never returns NULL X-Git-Tag: v1.7.3.2~30 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8713feb16dd6a472828bbdcf914a1c8f5c6810a2;p=git.git 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 Signed-off-by: Pat Thoyts Signed-off-by: Junio C Hamano --- diff --git a/connect.c b/connect.c index 3450cabd0..57dc20c43 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;