diff options
| author | Antony Dovgal <tony2001@php.net> | 2008-08-29 10:53:07 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2008-08-29 10:53:07 +0000 |
| commit | 914f8ceb09af3526588d6d45edda6fb8170413c8 (patch) | |
| tree | 38787a88d76ee7c7d3e28fb196865632a0b7e22d | |
| parent | 872257f7cc16f9a43c1810927610269a7e1f8c62 (diff) | |
| download | php-git-914f8ceb09af3526588d6d45edda6fb8170413c8.tar.gz | |
fix invalid read
weird, the code uses correct order of checks just ten lines below
| -rw-r--r-- | ext/fileinfo/libmagic/softmagic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index 6661fe4240..dc928658a5 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -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*/ } |
