Skip to content

Commit

Permalink
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
Browse files Browse the repository at this point in the history
# By Anatol Belski (2) and others
# Via Anatol Belski (3) and others
* 'PHP-5.6' of git.php.net:php-src:
  updated libmagic.patch
  updated libmagic.patch
  Fix indentation
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
  • Loading branch information
pierrejoye committed Mar 10, 2014
2 parents eef2978 + 8bda4c6 commit 52a44a7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 41 deletions.
1 change: 0 additions & 1 deletion Makefile.global
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ clean:
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
find . -name \*.1 | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*

distclean: clean
Expand Down
66 changes: 40 additions & 26 deletions ext/fileinfo/libmagic.patch
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -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. */
Expand All @@ -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 <err.h>
#endif
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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 @@
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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__
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <wctype.h>
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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 <locale.h>
#endif
Expand All @@ -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.
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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|
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions ext/mysqlnd/mysqlnd_wireprotocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,8 +1741,9 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval
zval_dtor(*current_field);
ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0);
}
} else
ZVAL_STRINGL(*current_field, (char *)p, len, 0);
} else {
ZVAL_STRINGL(*current_field, (char *)p, len, 0);
}
p += len;
last_field_was_string = TRUE;
}
Expand Down
12 changes: 6 additions & 6 deletions php.ini-development
Original file line number Diff line number Diff line change
Expand Up @@ -949,15 +949,15 @@ cli_server.color = On
;filter.default_flags =

[iconv]
; Use of this INI entory is deprecated, use global input_encoding instead.
; Use of this INI entry is deprecated, use global input_encoding instead.
; If empty, input_encoding is used.
;iconv.input_encoding =

; Use of this INI entory is deprecated, use global internal_encoding instead.
; Use of this INI entry is deprecated, use global internal_encoding instead.
; If empty, internal_encoding is used.
;iconv.internal_encoding =

; Use of this INI entory is deprecated, use global output_encoding instead.
; Use of this INI entry is deprecated, use global output_encoding instead.
; If empty, output_encoding is used.
;iconv.output_encoding =

Expand Down Expand Up @@ -1726,21 +1726,21 @@ mssql.secure_connection = Off
; http://php.net/mbstring.language
;mbstring.language = Japanese

; Use of this INI entory is deprecated, use global internal_encoding instead.
; Use of this INI entry is deprecated, use global internal_encoding instead.
; internal/script encoding.
; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
; If empty, default_charset or internal_encoding is used in order.
; http://php.net/mbstring.internal-encoding
;mbstring.internal_encoding =

; Use of this INI entory is deprecated, use global input_encoding instead.
; Use of this INI entry is deprecated, use global input_encoding instead.
; http input encoding.
; If empty, input_encoding is used.
; mbstring.encoding_traslation = On is needed to use this setting.
; http://php.net/mbstring.http-input
;mbstring.http_input =

; Use of this INI entory is deprecated, use global output_encoding instead.
; Use of this INI entry is deprecated, use global output_encoding instead.
; http output encoding.
; mb_output_handler must be registered as output buffer to function.
; If empty, output_encoding is used.
Expand Down
12 changes: 6 additions & 6 deletions php.ini-production
Original file line number Diff line number Diff line change
Expand Up @@ -947,15 +947,15 @@ cli_server.color = On
;filter.default_flags =

[iconv]
; Use of this INI entory is deprecated, use global input_encoding instead.
; Use of this INI entry is deprecated, use global input_encoding instead.
; If empty, input_encoding is used.
;iconv.input_encoding =

; Use of this INI entory is deprecated, use global internal_encoding instead.
; Use of this INI entry is deprecated, use global internal_encoding instead.
; If empty, internal_encoding is used.
;iconv.internal_encoding =

; Use of this INI entory is deprecated, use global output_encoding instead.
; Use of this INI entry is deprecated, use global output_encoding instead.
; If empty, output_encoding is used.
;iconv.output_encoding =

Expand Down Expand Up @@ -1724,21 +1724,21 @@ mssql.secure_connection = Off
; http://php.net/mbstring.language
;mbstring.language = Japanese

; Use of this INI entory is deprecated, use global internal_encoding instead.
; Use of this INI entry is deprecated, use global internal_encoding instead.
; internal/script encoding.
; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
; If empty, default_charset or internal_encoding is used in order.
; http://php.net/mbstring.internal-encoding
;mbstring.internal_encoding =

; Use of this INI entory is deprecated, use global input_encoding instead.
; Use of this INI entry is deprecated, use global input_encoding instead.
; http input encoding.
; If empty, input_encoding is used.
; mbstring.encoding_traslation = On is needed to use this setting.
; http://php.net/mbstring.http-input
;mbstring.http_input =

; Use of this INI entory is deprecated, use global output_encoding instead.
; Use of this INI entry is deprecated, use global output_encoding instead.
; http output encoding.
; mb_output_handler must be registered as output buffer to function.
; If empty, output_encoding is used.
Expand Down

0 comments on commit 52a44a7

Please sign in to comment.