Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-grub2
Commits
30e177a0
Commit
30e177a0
authored
Jan 20, 2015
by
Vladimir Serbinenko
Browse files
grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past the end of file.
parent
af435524
Changes
3
Show whitespace changes
Inline
Side-by-side
ChangeLog
View file @
30e177a0
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/bus/usb/usbtrans.c (grub_usb_bulk_maxpacket): Avoid
potentially returning 0.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past
the end of file.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/fshelp.c (grub_fshelp_read_file): Don't attempt to read
* grub-core/fs/fshelp.c (grub_fshelp_read_file): Don't attempt to read
grub-core/bus/usb/usbtrans.c
View file @
30e177a0
...
@@ -31,7 +31,7 @@ grub_usb_bulk_maxpacket (grub_usb_device_t dev,
...
@@ -31,7 +31,7 @@ grub_usb_bulk_maxpacket (grub_usb_device_t dev,
struct
grub_usb_desc_endp
*
endpoint
)
struct
grub_usb_desc_endp
*
endpoint
)
{
{
/* Use the maximum packet size given in the endpoint descriptor. */
/* 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
endpoint
->
maxpacket
;
return
64
;
return
64
;
...
...
grub-core/fs/minix.c
View file @
30e177a0
...
@@ -262,6 +262,13 @@ grub_minix_read_file (struct grub_minix_data *data,
...
@@ -262,6 +262,13 @@ grub_minix_read_file (struct grub_minix_data *data,
grub_uint32_t
posblock
;
grub_uint32_t
posblock
;
grub_uint32_t
blockoff
;
grub_uint32_t
blockoff
;
if
(
pos
>
GRUB_MINIX_INODE_SIZE
(
data
))
{
grub_error
(
GRUB_ERR_OUT_OF_RANGE
,
N_
(
"attempt to read past the end of file"
));
return
-
1
;
}
/* Adjust len so it we can't read past the end of the file. */
/* Adjust len so it we can't read past the end of the file. */
if
(
len
+
pos
>
GRUB_MINIX_INODE_SIZE
(
data
))
if
(
len
+
pos
>
GRUB_MINIX_INODE_SIZE
(
data
))
len
=
GRUB_MINIX_INODE_SIZE
(
data
)
-
pos
;
len
=
GRUB_MINIX_INODE_SIZE
(
data
)
-
pos
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment