1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00

fix invalid read

weird, the code uses correct order of checks just ten lines below
This commit is contained in:
Antony Dovgal
2008-08-29 10:53:07 +00:00
parent 872257f7cc
commit 914f8ceb09
+2 -2
View File
@@ -131,8 +131,8 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
if ((m->flag & BINTEST) != mode) {
/* Skip sub-tests */
while (magic[magindex + 1].cont_level != 0 && ++magindex < nmagic) {
continue;
while (magindex < nmagic - 1 && magic[magindex + 1].cont_level != 0) {
magindex++;
}
continue; /* Skip to next top-level test*/
}