提交 8713feb1 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

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: NJohannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 dbda9676
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册