diff options
Diffstat (limited to 'ext/fileinfo/libmagic/apprentice.c')
| -rw-r--r-- | ext/fileinfo/libmagic/apprentice.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 732ed8babb..c1dc5aa1fa 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -960,6 +960,8 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs, php_stream *stream; + TSRMLS_FETCH(); + ms->file = fn; stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); @@ -1149,6 +1151,8 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) php_stream *dir; php_stream_dirent d; + TSRMLS_FETCH(); + memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -2603,6 +2607,9 @@ apprentice_map(struct magic_set *ms, const char *fn) php_stream *stream = NULL; php_stream_statbuf st; + + TSRMLS_FETCH(); + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); efree(map); @@ -2754,6 +2761,8 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) uint32_t i; php_stream *stream; + TSRMLS_FETCH(); + dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -2811,6 +2820,7 @@ mkdbname(struct magic_set *ms, const char *fn, int strip) { const char *p, *q; char *buf; + TSRMLS_FETCH(); if (strip) { if ((p = strrchr(fn, '/')) != NULL) |
