mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-01 00:51:19 +00:00
Fix infinite loop in strings and better use of is_breaked() ##bin
This commit is contained in:
parent
1546300810
commit
d05035fc0e
@ -176,12 +176,11 @@ static int string_scan_range(RList *list, RBinFile *bf, int min,
|
||||
r_charset_free (ch);
|
||||
}
|
||||
free (charset);
|
||||
RConsIsBreaked is_breaked = (bin && bin->consb.is_breaked)? bin->consb.is_breaked: NULL;
|
||||
// may oobread
|
||||
while (needle < to) {
|
||||
if (bin && bin->consb.is_breaked) {
|
||||
if (bin->consb.is_breaked ()) {
|
||||
break;
|
||||
}
|
||||
if (is_breaked && is_breaked ()) {
|
||||
break;
|
||||
}
|
||||
// smol optimization
|
||||
if (needle + 4 < to) {
|
||||
@ -343,6 +342,7 @@ static int string_scan_range(RList *list, RBinFile *bf, int min,
|
||||
}
|
||||
free (block_list);
|
||||
if (num_blocks > R_STRING_MAX_UNI_BLOCKS) {
|
||||
needle++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user