diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 3fc5b078547a5..c83e4726e0874 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c --- libmagic.orig/apprentice.c Tue Nov 19 22:01:12 2013 -+++ libmagic/apprentice.c Thu Feb 20 02:06:36 2014 ++++ libmagic/apprentice.c Fri Feb 21 00:21:27 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -798,7 +798,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c --- libmagic.orig/ascmagic.c Thu Feb 13 00:20:53 2014 -+++ libmagic/ascmagic.c Thu Feb 20 02:06:36 2014 ++++ libmagic/ascmagic.c Fri Feb 21 00:21:27 2014 @@ -139,7 +139,7 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -820,7 +820,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c } diff -u libmagic.orig/cdf.c libmagic/cdf.c --- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013 -+++ libmagic/cdf.c Thu Feb 20 02:06:36 2014 ++++ libmagic/cdf.c Fri Feb 21 00:21:27 2014 @@ -43,7 +43,17 @@ #include #endif @@ -883,7 +883,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c } else { diff -u libmagic.orig/cdf.h libmagic/cdf.h --- libmagic.orig/cdf.h Thu Jun 21 00:19:55 2012 -+++ libmagic/cdf.h Thu Feb 20 02:06:36 2014 ++++ libmagic/cdf.h Fri Feb 21 00:21:27 2014 @@ -35,10 +35,12 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -926,7 +926,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h void cdf_unpack_header(cdf_header_t *, char *); diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c --- libmagic.orig/cdf_time.c Thu Jun 21 00:18:33 2012 -+++ libmagic/cdf_time.c Thu Feb 20 02:06:36 2014 ++++ libmagic/cdf_time.c Fri Feb 21 00:21:27 2014 @@ -96,7 +96,7 @@ } @@ -986,7 +986,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c static const char *ref = "Sat Apr 23 01:30:00 1977"; diff -u libmagic.orig/compress.c libmagic/compress.c --- libmagic.orig/compress.c Sun Jan 5 16:55:21 2014 -+++ libmagic/compress.c Thu Feb 20 02:06:36 2014 ++++ libmagic/compress.c Fri Feb 21 00:21:27 2014 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1149,7 +1149,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c +#endif /* if PHP_FILEINFO_UNCOMPRESS */ diff -u libmagic.orig/file.h libmagic/file.h --- libmagic.orig/file.h Thu Feb 13 00:20:53 2014 -+++ libmagic/file.h Thu Feb 20 02:06:36 2014 ++++ libmagic/file.h Fri Feb 21 00:21:27 2014 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1324,7 +1324,7 @@ diff -u libmagic.orig/file.h libmagic/file.h #endif /* __file_h__ */ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c --- libmagic.orig/fsmagic.c Sun Dec 1 20:22:13 2013 -+++ libmagic/fsmagic.c Thu Feb 20 02:06:36 2014 ++++ libmagic/fsmagic.c Fri Feb 21 00:21:27 2014 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1649,7 +1649,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } diff -u libmagic.orig/funcs.c libmagic/funcs.c --- libmagic.orig/funcs.c Thu Feb 13 00:20:53 2014 -+++ libmagic/funcs.c Thu Feb 20 02:06:36 2014 ++++ libmagic/funcs.c Fri Feb 28 14:01:53 2014 @@ -41,79 +41,76 @@ #if defined(HAVE_WCTYPE_H) #include @@ -1950,7 +1950,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c } diff -u libmagic.orig/magic.c libmagic/magic.c --- libmagic.orig/magic.c Sun Dec 1 20:22:13 2013 -+++ libmagic/magic.c Thu Feb 20 02:06:36 2014 ++++ libmagic/magic.c Fri Feb 21 00:21:27 2014 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2289,7 +2289,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c magic_error(struct magic_set *ms) diff -u libmagic.orig/magic.h libmagic/magic.h --- libmagic.orig/magic.h Wed Feb 19 10:53:11 2014 -+++ libmagic/magic.h Thu Feb 20 02:06:36 2014 ++++ libmagic/magic.h Fri Feb 21 00:21:27 2014 @@ -88,6 +88,7 @@ const char *magic_getpath(const char *, int); @@ -2308,7 +2308,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h diff -u libmagic.orig/print.c libmagic/print.c --- libmagic.orig/print.c Tue Feb 26 19:25:00 2013 -+++ libmagic/print.c Thu Feb 20 02:06:36 2014 ++++ libmagic/print.c Fri Feb 21 00:21:27 2014 @@ -28,13 +28,17 @@ /* * print.c - debugging printout routines @@ -2539,7 +2539,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c --- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014 -+++ libmagic/readcdf.c Thu Feb 20 02:06:36 2014 ++++ libmagic/readcdf.c Fri Feb 21 00:21:27 2014 @@ -30,7 +30,11 @@ #endif @@ -2603,7 +2603,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c *ec = '\0'; diff -u libmagic.orig/readelf.c libmagic/readelf.c --- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013 -+++ libmagic/readelf.c Thu Feb 20 02:06:36 2014 ++++ libmagic/readelf.c Fri Feb 21 00:21:27 2014 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2827,7 +2827,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (fstat(fd, &st) == -1) { diff -u libmagic.orig/readelf.h libmagic/readelf.h --- libmagic.orig/readelf.h Tue Nov 5 16:41:56 2013 -+++ libmagic/readelf.h Thu Feb 20 02:06:36 2014 ++++ libmagic/readelf.h Fri Feb 21 00:21:27 2014 @@ -44,9 +44,17 @@ typedef uint32_t Elf32_Word; typedef uint8_t Elf32_Char; @@ -2848,7 +2848,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h typedef uint8_t Elf64_Char; diff -u libmagic.orig/softmagic.c libmagic/softmagic.c --- libmagic.orig/softmagic.c Thu Feb 13 00:20:53 2014 -+++ libmagic/softmagic.c Thu Feb 20 19:03:18 2014 ++++ libmagic/softmagic.c Sun Mar 9 13:14:07 2014 @@ -50,6 +50,11 @@ #include #endif @@ -2866,8 +2866,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private void cvt_64(union VALUETYPE *, const struct magic *); -#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o))) -+/*#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o))) */ -+#define OFFSET_OOB(n, o, i) (n < o + i) ++#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o))) ++ /* * softmagic - lookup one file in parsed, in-memory copy of database * Passed the name and FILE * of one file to be typed. @@ -3003,18 +3003,32 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1759,7 +1737,9 @@ +@@ -1755,11 +1733,21 @@ + ms->offset = soffset; + if (rv == 1) { + if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && +- file_printf(ms, F(m->desc, "%u"), offset) == -1) ++ file_printf(ms, m->desc, offset) == -1) { ++ if (rbuf) { ++ efree(rbuf); ++ } return -1; - if (file_printf(ms, "%s", rbuf) == -1) +- if (file_printf(ms, "%s", rbuf) == -1) ++ } ++ if (file_printf(ms, "%s", rbuf) == -1) { ++ if (rbuf) { ++ efree(rbuf); ++ } return -1; - free(rbuf); ++ } + } + if (rbuf) { + efree(rbuf); } return rv; -@@ -1875,6 +1855,42 @@ +@@ -1875,6 +1863,42 @@ return file_strncmp(a, b, len, flags); } @@ -3057,16 +3071,13 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -2035,63 +2051,151 @@ +@@ -2035,63 +2059,151 @@ break; } case FILE_REGEX: { - int rc; - regex_t rx; - char errmsg[512]; -- -- if (ms->search.s == NULL) -- return 0; + zval *pattern; + int options = 0; + pcre_cache_entry *pce; @@ -3203,6 +3214,9 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + } + } +- if (ms->search.s == NULL) +- return 0; + - l = 0; - rc = regcomp(&rx, m->value.s, - REG_EXTENDED|REG_NEWLINE| @@ -3237,7 +3251,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c - (size_t)(pmatch[0].rm_eo - pmatch[0].rm_so); - v = 0; - break; - +- - case REG_NOMATCH: + } else { v = 1; diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index eb9258b15e891..9269864fb689b 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -626,7 +626,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) / if (chain_policy_status.dwError != 0) { /* The chain does not match the policy */ if (is_self_signed && chain_policy_status.dwError == CERT_E_UNTRUSTEDROOT - && GET_VER_OPT("allow_self_signed") && zend_is_true(*val)) { + && GET_VER_OPT("allow_self_signed") && zend_is_true(*val TSRMLS_CC)) { /* allow self-signed certs */ X509_STORE_CTX_set_error(x509_store_ctx, X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT); } else {