mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-24 08:09:22 +00:00
* grub-core/fs/udf.c (read_string): Bail out on size=0.
(grub_udf_read_symlink): Handle read_string failure.
This commit is contained in:
1 parent
5eae317511
commit
def3df7520
2 files changed
+10
-1
No files matched your search
+5
-1
@@ -807,6 +807,9 @@ read_string (const grub_uint8_t *raw, grub_size_t sz, char *outbuf)
|
||||
grub_uint16_t *utf16 = NULL;
|
||||
grub_size_t utf16len = 0;
|
||||
|
||||
if (sz == 0)
|
||||
return NULL;
|
||||
|
||||
if (raw[0] != 8 && raw[0] != 16)
|
||||
return NULL;
|
||||
|
||||
@@ -989,7 +992,8 @@ grub_udf_read_symlink (grub_fshelp_node_t node)
|
||||
/* in 4 + n bytes. out, at most: 1 + 2 * n bytes. */
|
||||
if (optr != out)
|
||||
*optr++ = '/';
|
||||
read_string (ptr + 4, s - 4, optr);
|
||||
if (!read_string (ptr + 4, s - 4, optr))
|
||||
goto fail;
|
||||
optr += grub_strlen (optr);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user