mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-25 06:09:50 +00:00
Fix softmagic crash in PE bin (reported by @daniel-rome)
This commit is contained in:
parent
465a0338c3
commit
74ccde1168
@ -1313,9 +1313,10 @@ static int magiccheck(RMagic *ms, struct r_magic *m) {
|
||||
v = 0;
|
||||
|
||||
for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
|
||||
if ((int)ms->search.offset < 0)
|
||||
break;
|
||||
if (slen + idx > ms->search.s_len)
|
||||
break;
|
||||
|
||||
v = file_strncmp (m->value.s, ms->search.s + idx, slen, m->str_flags);
|
||||
if (v == 0) { /* found match */
|
||||
ms->search.offset += idx;
|
||||
|
Loading…
Reference in New Issue
Block a user