mirror of
https://github.com/git/git.git
synced 2026-03-17 20:20:08 +01:00
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>
This commit is contained in:
@@ -628,8 +628,12 @@ char *git_getpass(const char *prompt)
|
||||
|
||||
askpass = getenv("GIT_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;
|
||||
|
||||
Reference in New Issue
Block a user