grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past the end of file.

This commit is contained in:
Vladimir Serbinenko 2015-01-20 13:55:55 +01:00
parent af435524cd
commit 30e177a05b
3 changed files with 18 additions and 1 deletions

View file

@ -31,7 +31,7 @@ grub_usb_bulk_maxpacket (grub_usb_device_t dev,
struct grub_usb_desc_endp *endpoint)
{
/* Use the maximum packet size given in the endpoint descriptor. */
if (dev->initialized && endpoint)
if (dev->initialized && endpoint && (unsigned int) endpoint->maxpacket)
return endpoint->maxpacket;
return 64;