mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-02 19:26:43 +00:00
Fix #8748 - Fix oobread on string search
This commit is contained in:
parent
dc8cff2f4d
commit
d31c4d3cbd
@ -352,16 +352,16 @@ static int string_scan_range(RList *list, const ut8 *buf, int min,
|
||||
// TODO: move into adjust_offset
|
||||
switch (str_type) {
|
||||
case R_STRING_TYPE_WIDE:
|
||||
{
|
||||
const ut8 *p = buf + str_start - 2;
|
||||
if (str_start > 1) {
|
||||
const ut8 *p = buf + str_start - 2;
|
||||
if (p[0] == 0xff && p[1] == 0xfe) {
|
||||
str_start -= 2; // \xff\xfe
|
||||
}
|
||||
}
|
||||
break;
|
||||
case R_STRING_TYPE_WIDE32:
|
||||
{
|
||||
const ut8 *p = buf + str_start - 4;
|
||||
if (str_start > 3) {
|
||||
const ut8 *p = buf + str_start - 4;
|
||||
if (p[0] == 0xff && p[1] == 0xfe) {
|
||||
str_start -= 4; // \xff\xfe\x00\x00
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user