mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
added a goto if fgets fails
This commit is contained in:
parent
2b12703ae1
commit
cd4a540c1f
@ -166,8 +166,10 @@ char * tgetpass(prompt, timeout)
|
||||
}
|
||||
|
||||
/* get the password */
|
||||
if (!fgets(buf, sizeof(buf), input))
|
||||
if (!fgets(buf, sizeof(buf), input)) {
|
||||
buf[0] = '\0';
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (*(tmp = &buf[strlen(buf)-1]) == '\n')
|
||||
*tmp = '\0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user