mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-15 20:05:46 +08:00
* resres.c (probe_binary): Fix test for badly formatted headers.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2007-06-18 Thomas Weidenmueller <w3seek@reactos.org>
|
||||||
|
|
||||||
|
* resres.c (probe_binary): Fix test for badly formatted headers.
|
||||||
|
|
||||||
2007-06-18 Kai Tietz <Kai.Tietz@onevision.com>
|
2007-06-18 Kai Tietz <Kai.Tietz@onevision.com>
|
||||||
|
|
||||||
* rclex.c: (cpp_line): Add code_page pragma support.
|
* rclex.c: (cpp_line): Add code_page pragma support.
|
||||||
|
@ -554,10 +554,12 @@ read_unistring (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax,
|
|||||||
rc_uint_type l;
|
rc_uint_type l;
|
||||||
rc_uint_type soff = off[0];
|
rc_uint_type soff = off[0];
|
||||||
|
|
||||||
do {
|
do
|
||||||
read_res_data (wrbfd, &soff, omax, d, sizeof (unichar));
|
{
|
||||||
c = windres_get_16 (wrbfd, d, 2);
|
read_res_data (wrbfd, &soff, omax, d, sizeof (unichar));
|
||||||
} while (c != 0);
|
c = windres_get_16 (wrbfd, d, 2);
|
||||||
|
}
|
||||||
|
while (c != 0);
|
||||||
l = ((soff - off[0]) / sizeof (unichar));
|
l = ((soff - off[0]) / sizeof (unichar));
|
||||||
|
|
||||||
/* there are hardly any names longer than 256 characters, but anyway. */
|
/* there are hardly any names longer than 256 characters, but anyway. */
|
||||||
@ -592,8 +594,11 @@ probe_binary (windres_bfd *wrbfd, rc_uint_type omax)
|
|||||||
if ((off + BIN_RES_HDR_SIZE) >= omax)
|
if ((off + BIN_RES_HDR_SIZE) >= omax)
|
||||||
return 1;
|
return 1;
|
||||||
read_res_data_hdr (wrbfd, &off, omax, &reshdr);
|
read_res_data_hdr (wrbfd, &off, omax, &reshdr);
|
||||||
if ((off + reshdr.data_size + reshdr.header_size) > omax)
|
/* off is advanced by BIN_RES_HDR_SIZE in read_res_data_hdr()
|
||||||
return 0;
|
which is part of reshdr.header_size. We shouldn't take it
|
||||||
|
into account twice. */
|
||||||
|
if ((off - BIN_RES_HDR_SIZE + reshdr.data_size + reshdr.header_size) > omax)
|
||||||
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user