diff options
author | Christos Zoulas <christos@zoulas.com> | 2022-04-18 21:46:43 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2022-04-18 21:46:43 +0000 |
commit | d1a00ae92b2cf09298615cf3aba474d8fec7380f (patch) | |
tree | 51a65c81c56296fa051abfc489bfd52eaea7ac90 | |
parent | b7fb9235117b3702a0f69956d131af912debc597 (diff) | |
download | file-git-d1a00ae92b2cf09298615cf3aba474d8fec7380f.tar.gz |
From Dirk Mueller:
when name/use was used, the regex caching table was incorrectly
initialized, which led to false or missing matches.
-rw-r--r-- | src/apprentice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/apprentice.c b/src/apprentice.c index 804c0e33..992102b4 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.321 2022/04/11 18:14:41 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.322 2022/04/18 21:46:43 christos Exp $") #endif /* lint */ #include "magic.h" @@ -3678,11 +3678,11 @@ file_magicfind(struct magic_set *ms, const char *name, struct mlist *v) continue; if (strcmp(ma[i].value.s, name) == 0) { v->magic = &ma[i]; + v->magic_rxcomp = &(ml->magic_rxcomp[i]); for (j = i + 1; j < ml->nmagic; j++) if (ma[j].cont_level == 0) break; v->nmagic = j - i; - v->magic_rxcomp = ml->magic_rxcomp; return 0; } } |