diff options
Diffstat (limited to 'ext/fileinfo')
-rw-r--r-- | ext/fileinfo/fileinfo.c | 2 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/apprentice.c | 6 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/cdf.c | 10 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/compress.c | 4 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/elfclass.h | 6 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/fsmagic.c | 2 | ||||
-rw-r--r-- | ext/fileinfo/libmagic/readelf.c | 52 |
7 files changed, 41 insertions, 41 deletions
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 4ba687f4d3..db309de181 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -480,7 +480,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime case FILEINFO_MODE_STREAM: { php_stream *stream; - php_off_t streampos; + zend_off_t streampos; php_stream_from_zval_no_verify(stream, what); if (!stream) { diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index b3b1f746d4..41a3ac5239 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -1145,7 +1145,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) uint32_t i, j; size_t files = 0, maxfiles = 0; char **filearr = NULL; - php_stat_t st; + zend_stat_t st; struct magic_map *map; struct magic_entry_set mset[MAGIC_SETS]; php_stream *dir; @@ -2698,7 +2698,7 @@ internal_loaded: if (NULL != fn) { nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); entries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); - if ((php_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { + if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu", dbname, (unsigned long long)st.sb.st_size, sizeof(struct magic)); @@ -2788,7 +2788,7 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) assert(nm + sizeof(ar) < m); - if (php_stream_seek(stream,(php_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) { + if (php_stream_seek(stream,(zend_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) { file_error(ms, errno, "error seeking `%s'", dbname); goto out; } diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c index 93cc231884..45ad6e3e57 100644 --- a/ext/fileinfo/libmagic/cdf.c +++ b/ext/fileinfo/libmagic/cdf.c @@ -291,11 +291,11 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h, } static ssize_t -cdf_read(const cdf_info_t *info, php_off_t off, void *buf, size_t len) +cdf_read(const cdf_info_t *info, zend_off_t off, void *buf, size_t len) { size_t siz = (size_t)off + len; - if ((php_off_t)(off + len) != (php_off_t)siz) { + if ((zend_off_t)(off + len) != (zend_off_t)siz) { errno = EINVAL; return -1; } @@ -308,7 +308,7 @@ cdf_read(const cdf_info_t *info, php_off_t off, void *buf, size_t len) if (info->i_fd == -1) return -1; - if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (php_off_t)-1) + if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (zend_off_t)-1) return -1; if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len) @@ -323,7 +323,7 @@ cdf_read_header(const cdf_info_t *info, cdf_header_t *h) char buf[512]; (void)memcpy(cdf_bo.s, "\01\02\03\04", 4); - if (cdf_read(info, (php_off_t)0, buf, sizeof(buf)) == -1) + if (cdf_read(info, (zend_off_t)0, buf, sizeof(buf)) == -1) return -1; cdf_unpack_header(h, buf); cdf_swap_header(h); @@ -357,7 +357,7 @@ cdf_read_sector(const cdf_info_t *info, void *buf, size_t offs, size_t len, size_t ss = CDF_SEC_SIZE(h); size_t pos = CDF_SEC_POS(h, id); assert(ss == len); - return cdf_read(info, (php_off_t)pos, ((char *)buf) + offs, len); + return cdf_read(info, (zend_off_t)pos, ((char *)buf) + offs, len); } ssize_t diff --git a/ext/fileinfo/libmagic/compress.c b/ext/fileinfo/libmagic/compress.c index 613fc6a3d2..0da5a3e6ce 100644 --- a/ext/fileinfo/libmagic/compress.c +++ b/ext/fileinfo/libmagic/compress.c @@ -300,7 +300,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf, return -1; } (void)close(tfd); - if (FINFO_LSEEK_FUNC(fd, (php_off_t)0, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -406,7 +406,7 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method, (void) close(0); if (fd != -1) { (void) dup(fd); - (void) FINFO_LSEEK_FUNC(0, (php_off_t)0, SEEK_SET); + (void) FINFO_LSEEK_FUNC(0, (zend_off_t)0, SEEK_SET); } else { (void) dup(fdin[0]); (void) close(fdin[0]); diff --git a/ext/fileinfo/libmagic/elfclass.h b/ext/fileinfo/libmagic/elfclass.h index 889ff6263e..bfacceb88a 100644 --- a/ext/fileinfo/libmagic/elfclass.h +++ b/ext/fileinfo/libmagic/elfclass.h @@ -37,7 +37,7 @@ case ET_CORE: flags |= FLAGS_IS_CORE; if (dophn_core(ms, clazz, swap, fd, - (php_off_t)elf_getu(swap, elfhdr.e_phoff), + (zend_off_t)elf_getu(swap, elfhdr.e_phoff), elf_getu16(swap, elfhdr.e_phnum), (size_t)elf_getu16(swap, elfhdr.e_phentsize), fsize, &flags) == -1) @@ -47,7 +47,7 @@ case ET_EXEC: case ET_DYN: if (dophn_exec(ms, clazz, swap, fd, - (php_off_t)elf_getu(swap, elfhdr.e_phoff), + (zend_off_t)elf_getu(swap, elfhdr.e_phoff), elf_getu16(swap, elfhdr.e_phnum), (size_t)elf_getu16(swap, elfhdr.e_phentsize), fsize, &flags, elf_getu16(swap, elfhdr.e_shnum)) @@ -56,7 +56,7 @@ /*FALLTHROUGH*/ case ET_REL: if (doshn(ms, clazz, swap, fd, - (php_off_t)elf_getu(swap, elfhdr.e_shoff), + (zend_off_t)elf_getu(swap, elfhdr.e_shoff), elf_getu16(swap, elfhdr.e_shnum), (size_t)elf_getu16(swap, elfhdr.e_shentsize), fsize, &flags, elf_getu16(swap, elfhdr.e_machine), diff --git a/ext/fileinfo/libmagic/fsmagic.c b/ext/fileinfo/libmagic/fsmagic.c index f945d06a8b..a7b420ff5d 100644 --- a/ext/fileinfo/libmagic/fsmagic.c +++ b/ext/fileinfo/libmagic/fsmagic.c @@ -90,7 +90,7 @@ handle_mime(struct magic_set *ms, int mime, const char *str) } protected int -file_fsmagic(struct magic_set *ms, const char *fn, php_stat_t *sb, php_stream *stream) +file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream) { int ret, did = 0; int mime = ms->flags & MAGIC_MIME; diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index ec316b6bbd..3b0aae54c1 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -42,13 +42,13 @@ FILE_RCSID("@(#)$File: readelf.c,v 1.99 2013/11/05 15:44:01 christos Exp $") #include "magic.h" #ifdef ELFCORE -private int dophn_core(struct magic_set *, int, int, int, php_off_t, int, size_t, - php_off_t, int *); +private int dophn_core(struct magic_set *, int, int, int, zend_off_t, int, size_t, + zend_off_t, int *); #endif private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, - php_off_t, int *, int); + zend_off_t, int *, int); private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, - php_off_t, int *, int); + zend_off_t, int *, int); private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int, int, size_t, int *); @@ -144,7 +144,7 @@ getu64(int swap, uint64_t value) #define xsh_size (size_t)(clazz == ELFCLASS32 \ ? elf_getu32(swap, sh32.sh_size) \ : elf_getu64(swap, sh64.sh_size)) -#define xsh_offset (php_off_t)(clazz == ELFCLASS32 \ +#define xsh_offset (zend_off_t)(clazz == ELFCLASS32 \ ? elf_getu32(swap, sh32.sh_offset) \ : elf_getu64(swap, sh64.sh_offset)) #define xsh_type (clazz == ELFCLASS32 \ @@ -162,13 +162,13 @@ getu64(int swap, uint64_t value) #define xph_type (clazz == ELFCLASS32 \ ? elf_getu32(swap, ph32.p_type) \ : elf_getu32(swap, ph64.p_type)) -#define xph_offset (php_off_t)(clazz == ELFCLASS32 \ +#define xph_offset (zend_off_t)(clazz == ELFCLASS32 \ ? elf_getu32(swap, ph32.p_offset) \ : elf_getu64(swap, ph64.p_offset)) #define xph_align (size_t)((clazz == ELFCLASS32 \ - ? (php_off_t) (ph32.p_align ? \ + ? (zend_off_t) (ph32.p_align ? \ elf_getu32(swap, ph32.p_align) : 4) \ - : (php_off_t) (ph64.p_align ? \ + : (zend_off_t) (ph64.p_align ? \ elf_getu64(swap, ph64.p_align) : 4))) #define xph_filesz (size_t)((clazz == ELFCLASS32 \ ? elf_getu32(swap, ph32.p_filesz) \ @@ -293,8 +293,8 @@ private const char os_style_names[][8] = { #define FLAGS_IS_CORE 0x10 private int -dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, - int num, size_t size, php_off_t fsize, int *flags) +dophn_core(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off, + int num, size_t size, zend_off_t fsize, int *flags) { Elf32_Phdr ph32; Elf64_Phdr ph64; @@ -312,7 +312,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, * Loop through all the program headers. */ for ( ; num; num--) { - if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -334,7 +334,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, * This is a PT_NOTE section; loop through all the notes * in the section. */ - if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -917,7 +917,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, Elf64_Shdr sh64; int stripped = 1; void *nbuf; - php_off_t noff, coff, name_off; + zend_off_t noff, coff, name_off; uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */ uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */ char name[50]; @@ -929,7 +929,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, } for ( ; num; num--) { - if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -959,8 +959,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, switch (xsh_type) { case SHT_NOTE: nbuf = emalloc((size_t)xsh_size); - if ((noff = FINFO_LSEEK_FUNC(fd, (php_off_t)xsh_offset, SEEK_SET)) == - (php_off_t)-1) { + if ((noff = FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET)) == + (zend_off_t)-1) { file_badread(ms); efree(nbuf); return -1; @@ -974,7 +974,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, noff = 0; for (;;) { - if (noff >= (php_off_t)xsh_size) + if (noff >= (zend_off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, (size_t)xsh_size, clazz, swap, 4, @@ -985,8 +985,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, efree(nbuf); break; case SHT_SUNW_cap: - if (FINFO_LSEEK_FUNC(fd, (php_off_t)xsh_offset, SEEK_SET) == - (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET) == + (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -996,7 +996,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, Elf64_Cap cap64; char cbuf[/*CONSTCOND*/ MAX(sizeof cap32, sizeof cap64)]; - if ((coff += xcap_sizeof) > (php_off_t)xsh_size) + if ((coff += xcap_sizeof) > (zend_off_t)xsh_size) break; if (FINFO_READ_FUNC(fd, cbuf, (size_t)xcap_sizeof) != (ssize_t)xcap_sizeof) { @@ -1099,8 +1099,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, * otherwise it's statically linked. */ private int -dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, - int num, size_t size, php_off_t fsize, int *flags, int sh_num) +dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off, + int num, size_t size, zend_off_t fsize, int *flags, int sh_num) { Elf32_Phdr ph32; Elf64_Phdr ph64; @@ -1117,7 +1117,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, } for ( ; num; num--) { - if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -1161,7 +1161,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, php_off_t off, * This is a PT_NOTE section; loop through all the notes * in the section. */ - if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (php_off_t)-1) { + if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -1204,7 +1204,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf, int clazz; int swap; struct stat st; - php_off_t fsize; + zend_off_t fsize; int flags = 0; Elf32_Ehdr elf32hdr; Elf64_Ehdr elf64hdr; @@ -1227,7 +1227,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf, /* * If we cannot seek, it must be a pipe, socket or fifo. */ - if((FINFO_LSEEK_FUNC(fd, (php_off_t)0, SEEK_SET) == (php_off_t)-1) && (errno == ESPIPE)) + if((FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) && (errno == ESPIPE)) fd = file_pipe2file(ms, fd, buf, nbytes); if (fstat(fd, &st) == -1) { |