diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index f1de79bad88..8347afdeb7b 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -3005,7 +3005,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) { static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS; static const size_t m = sizeof(**map->magic); - int fd = -1; size_t len; char *dbname; int rv = -1; diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c index 91e9906dcdc..c6699d5147e 100644 --- a/ext/fileinfo/libmagic/funcs.c +++ b/ext/fileinfo/libmagic/funcs.c @@ -61,7 +61,6 @@ extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, i protected int file_printf(struct magic_set *ms, const char *fmt, ...) { - int rv; va_list ap; int len; char *buf = NULL, *newstr; @@ -283,7 +282,9 @@ simple: if (file_printf(ms, "%s", code_mime) == -1) rv = -1; } +#if PHP_FILEINFO_UNCOMPRESS done_encoding: +#endif free(u8buf); if (rv) return rv; @@ -438,7 +439,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep) (void)setlocale(LC_CTYPE, "C"); opts |= PCRE_MULTILINE; - convert_libmagic_pattern(&patt, pat, strlen(pat), opts); + convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts); if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) { zval_ptr_dtor(&patt); rep_cnt = -1; diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index 9e876d39b3b..41c4aa17d77 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -2040,7 +2040,7 @@ magiccheck(struct magic_set *ms, struct magic *m) /* Need to fetch global match which equals pmatch[0] */ zval *pzval; HashTable *ht = Z_ARRVAL(subpats); - if ((pzval = zend_hash_index_find(ht, 0)) != NULL) { + if ((pzval = zend_hash_index_find(ht, 0)) != NULL && Z_TYPE_P(pzval) == IS_ARRAY) { /* If everything goes according to the master plan tmpcopy now contains two elements: 0 = the match