mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
* grub-core/osdep/unix/password.c (grub_password_get): Check that
fgets succeeded.
This commit is contained in:
1 parent
b67422d33d
commit
83c256ba42
2 files changed
+8
-1
No files matched your search
@@ -51,7 +51,9 @@ grub_password_get (char buf[], unsigned buf_size)
|
||||
}
|
||||
else
|
||||
tty_changed = 0;
|
||||
fgets (buf, buf_size, stdin);
|
||||
grub_memset (buf, 0, buf_size);
|
||||
if (!fgets (buf, buf_size, stdin))
|
||||
return 0;
|
||||
ptr = buf + strlen (buf) - 1;
|
||||
while (buf <= ptr && (*ptr == '\n' || *ptr == '\r'))
|
||||
*ptr-- = 0;
|
||||
|
||||
Reference in new issue
Block a user