Merge branch 'master' into sccp

* master:
  Bump OCI8 version for recent patch
  WS
  Fix test title
  Ensure that the stream position is kept between reads
  Turn off EXIF_DEBUG so Travis don't complain at me
  Don't add a new line to undefined tags in EXIF_DEBUG mode
  Fix compile error with EXIF_DEBUG
  update NEWS
  disable --with-pcre-valgrind on travis
  fix default args for --with-pcre-valgrind
  Enable valgrind support for PCRE by default in debug builds
  add oniguruma.patch to ease future upgrades
  SIZEOF_SIZE_T doesn't exist on AIX and POWER8 (ppc64le), keep using SIZEOF_LONG
This commit is contained in:
Dmitry Stogov 2017-07-14 13:30:39 +03:00
commit 1f261d77cb
11 changed files with 155 additions and 18 deletions

5
.gitignore vendored
View file

@ -229,3 +229,8 @@ win32/wsyslog.h
**/tests/**/*.db
**/tests/**/*.txt
**/tests/**/*.tmp
# special cases to invert previous ignore rules
!ext/fileinfo/libmagic.patch
!ext/mbstring/oniguruma.patch

2
NEWS
View file

@ -11,6 +11,8 @@ PHP NEWS
php_parse_date()). (Derick)
. Fixed bug #49649 (unserialize() doesn't handle changes in property
visibility). (pmmaga)
. Fixed #74866 (extension_dir = "./ext" now use current directory for base).
(Francois Laupretre)
- Date:
. Fixed bug #74852 (property_exists returns true on unknown DateInterval

View file

@ -1552,7 +1552,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
return value_ptr ? value_ptr : "<no data>";
}
if (format == TAG_FMT_UNDEFINED) {
return "<undefined>\n";
return "<undefined>";
}
if (format == TAG_FMT_IFD) {
return "";
@ -3723,7 +3723,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo)
unsigned int ll, lh;
uchar *Data;
size_t fpos, size, got, itemlen;
jpeg_sof_info sof_info;
jpeg_sof_info sof_info;
for(section=0;;section++) {
#ifdef EXIF_DEBUG
@ -4305,9 +4305,9 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
}
/* }}} */
/* {{{ exif_read_from_stream
/* {{{ exif_read_from_impl
*/
static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
{
int ret;
zend_stat_t st;
@ -4368,6 +4368,27 @@ static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream,
}
/* }}} */
/* {{{ exif_read_from_stream
*/
static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream, int read_thumbnail, int read_all)
{
int ret;
off_t old_pos = php_stream_tell(stream);
if (old_pos) {
php_stream_seek(stream, 0, SEEK_SET);
}
ret = exif_read_from_impl(ImageInfo, stream, read_thumbnail, read_all);
if (old_pos) {
php_stream_seek(stream, old_pos, SEEK_SET);
}
return ret;
}
/* }}} */
/* {{{ exif_read_from_file
*/
static int exif_read_from_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
@ -4590,7 +4611,7 @@ PHP_FUNCTION(exif_read_data)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
php_error_docref1(NULL, p_name, E_NOTICE, "done");
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
#endif
}
/* }}} */
@ -4672,7 +4693,7 @@ PHP_FUNCTION(exif_thumbnail)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
php_error_docref1(NULL, p_name, E_NOTICE, "Done");
php_error_docref1(NULL, (Z_TYPE_P(stream) == IS_RESOURCE ? "<stream>" : Z_STRVAL_P(stream)), E_NOTICE, "Done");
#endif
}
/* }}} */

View file

@ -0,0 +1,21 @@
--TEST--
exif_read_data() with streams seeking test
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--INI--
output_handler=
zlib.output_compression=0
--FILE--
<?php
$fp = fopen(__DIR__ . '/image027.tiff', 'rb');
fseek($fp, 100, SEEK_SET);
exif_read_data($fp);
var_dump(ftell($fp) === 100);
fclose($fp);
?>
--EXPECT--
bool(true)

View file

@ -0,0 +1,61 @@
diff -wur oniguruma.orig/src/config.h.win32 oniguruma/src/config.h.win32
--- oniguruma.orig/src/config.h.win32 2017-07-13 17:12:45.228068900 +0200
+++ oniguruma/src/config.h.win32 2017-07-13 16:11:19.955226200 +0200
@@ -15,6 +15,7 @@
#define SIZEOF_VOIDP 4
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
+#define SIZEOF_SIZE_T 4
#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1
diff -wur oniguruma.orig/src/config.h.win64 oniguruma/src/config.h.win64
--- oniguruma.orig/src/config.h.win64 2017-07-13 17:12:45.273605000 +0200
+++ oniguruma/src/config.h.win64 2017-07-13 16:11:19.957231300 +0200
@@ -15,6 +15,7 @@
#define SIZEOF_VOIDP 8
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
+#define SIZEOF_SIZE_T 8
#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1
diff -wur oniguruma.orig/src/regint.h oniguruma/src/regint.h
--- oniguruma.orig/src/regint.h 2017-07-13 17:12:48.686073300 +0200
+++ oniguruma/src/regint.h 2017-07-13 17:13:28.032286100 +0200
@@ -201,17 +201,21 @@
} while(0)
/* sizeof(OnigCodePoint) */
+#ifdef SIZEOF_SIZE_T
+# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
+#else
#define WORD_ALIGNMENT_SIZE SIZEOF_LONG
+#endif
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
(pad_size) = WORD_ALIGNMENT_SIZE \
- - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
+ - ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
} while (0)
#define ALIGNMENT_RIGHT(addr) do {\
(addr) += (WORD_ALIGNMENT_SIZE - 1);\
- (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
+ (addr) -= ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
} while (0)
#endif /* PLATFORM_UNALIGNED_WORD_ACCESS */
@@ -662,7 +666,11 @@
BBuf* mbuf; /* multi-byte info or NULL */
} CClassNode;
+#ifdef _WIN64
+typedef __int64 OnigStackIndex;
+#else
typedef long OnigStackIndex;
+#endif
typedef struct _OnigStackType {
unsigned int type;

View file

@ -201,7 +201,11 @@
} while(0)
/* sizeof(OnigCodePoint) */
#define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
#ifdef SIZEOF_SIZE_T
# define WORD_ALIGNMENT_SIZE SIZEOF_SIZE_T
#else
# define WORD_ALIGNMENT_SIZE SIZEOF_LONG
#endif
#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
(pad_size) = WORD_ALIGNMENT_SIZE \

View file

@ -50,8 +50,8 @@ Interoperability Support" (ID 207303.1) for details.
<time>12:00:00</time>
<version>
<release>2.1.5</release>
<api>2.1.5</api>
<release>2.1.6</release>
<api>2.1.6</api>
</version>
<stability>
<release>stable</release>
@ -60,7 +60,6 @@ Interoperability Support" (ID 207303.1) for details.
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Added TAF callback support (PR #2459, KoenigsKind)
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
</notes>
<contents>
@ -471,6 +470,22 @@ Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.5</release>
<api>2.1.5</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Added TAF callback support (PR #2459, KoenigsKind)
</notes>
</release>
<release>
<version>
<release>2.1.4</release>

View file

@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.5"
#define PHP_OCI8_VERSION "2.1.6"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry

View file

@ -57,11 +57,11 @@ function get_attr($conn)
?>
--EXPECT--
**Test 1.1 - Default values for the attribute **************
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
***Test 1.2 - Get the values from different connections **************
Testing with oci_pconnect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
Testing with oci_new_connect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.5
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
Done

View file

@ -78,12 +78,20 @@ PHP_ARG_WITH(pcre-jit,,[ --with-pcre-jit Enable PCRE JIT functionality]
fi
fi
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
Enable PCRE valgrind support. Developers only!], no, no)
if test "$PHP_DEBUG" != "no" && test "$PHP_DEBUG" != "0"; then
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
Enable PCRE valgrind support. Developers only!], yes, no)
else
PHP_ARG_WITH(pcre-valgrind,,[ --with-pcre-valgrind=DIR
Enable PCRE valgrind support. Developers only!], no, no)
fi
if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
AC_MSG_WARN([PHP is going to be linked with an external PCRE, --with-pcre-valgrind has no effect])
else
if test "$PHP_PCRE_VALGRIND" != "no"; then
if test "$PHP_PCRE_VALGRIND" = "no" && test "$PHP_DEBUG" != "0"; then
AC_MSG_NOTICE([PCRE Valgrind support is disabled for debug build])
elif test "$PHP_PCRE_VALGRIND" != "no" || test "$PHP_DEBUG" != "0"; then
PHP_PCRE_VALGRIND_INCDIR=
AC_MSG_CHECKING([for Valgrind headers location])
for i in $PHP_PCRE_VALGRIND $PHP_PCRE_VALGRIND/include $PHP_PCRE_VALGRIND/local/include /usr/include /usr/local/include; do

View file

@ -5,7 +5,7 @@ else
TS="";
fi
if [[ "$ENABLE_DEBUG" == 1 ]]; then
DEBUG="--enable-debug";
DEBUG="--enable-debug --without-pcre-valgrind";
else
DEBUG="";
fi