* grub-core/osdep/unix/password.c (grub_password_get): Check that
fgets succeeded.
This commit is contained in:
parent
b67422d33d
commit
83c256ba42
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/osdep/unix/password.c (grub_password_get): Check that
|
||||||
|
fgets succeeded.
|
||||||
|
|
||||||
2013-11-27 Francesco Lavra <francescolavra.fl@gmail.com>
|
2013-11-27 Francesco Lavra <francescolavra.fl@gmail.com>
|
||||||
|
|
||||||
* docs/grub.texi (ls): Fix command description in case of a device name
|
* docs/grub.texi (ls): Fix command description in case of a device name
|
||||||
|
|
|
@ -51,7 +51,9 @@ grub_password_get (char buf[], unsigned buf_size)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tty_changed = 0;
|
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;
|
ptr = buf + strlen (buf) - 1;
|
||||||
while (buf <= ptr && (*ptr == '\n' || *ptr == '\r'))
|
while (buf <= ptr && (*ptr == '\n' || *ptr == '\r'))
|
||||||
*ptr-- = 0;
|
*ptr-- = 0;
|
||||||
|
|
Loading…
Reference in a new issue