mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-05 12:57:34 +00:00
Fix read overflow in libr_magic
This commit is contained in:
parent
beda5fd111
commit
d7747ab831
@ -167,7 +167,7 @@ static int match(RMagic *ms, struct r_magic *magic, ut32 nmagic, const ut8 *s, s
|
||||
if (file_check_mem(ms, ++cont_level) == -1)
|
||||
return -1;
|
||||
|
||||
while (magic[magindex+1].cont_level != 0 && ++magindex < nmagic - 1) {
|
||||
while (magic[magindex].cont_level != 0 && magic[magindex+1].cont_level != 0 && ++magindex < nmagic - 1) {
|
||||
m = &magic[magindex];
|
||||
ms->line = m->lineno; /* for messages */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user