diff --git a/NEWS b/NEWS index 9c400e04374..8a05976893c 100644 --- a/NEWS +++ b/NEWS @@ -13,10 +13,18 @@ PHP NEWS - GD: . Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb) +- IMAP: + . Fixed bug #72324 (imap_mailboxmsginfo() return wrong size). + (ronaldpoon at udomain dot com dot hk, Kalle) + - OpenSSL: . Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()). (Stas) +- PCRE: + . Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()). + (Dmitry) + 06 Jul 2017, PHP 7.2.0alpha3 - Core: @@ -63,7 +71,7 @@ PHP NEWS 22 Jun 2017, PHP 7.2.0alpha2 - Core: - . Change PHP_OS_FAMILY value from "OSX" to "Darwin". (sb, kalle) + . Change PHP_OS_FAMILY value from "OSX" to "Darwin". (Sebastian, Kalle) - GD: . Fixed bug #74744 (gd.h: stdarg.h include missing for va_list use in diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 0f6ac9a2d0d..17456e3df79 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2601,7 +2601,8 @@ PHP_FUNCTION(imap_mailboxmsginfo) zval *streamind; pils *imap_le_struct; char date[100]; - unsigned int msgno, unreadmsg, deletedmsg, msize; + unsigned long msgno; + zend_ulong unreadmsg = 0, deletedmsg = 0, msize = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) { return; @@ -2614,10 +2615,6 @@ PHP_FUNCTION(imap_mailboxmsginfo) /* Initialize return object */ object_init(return_value); - unreadmsg = 0; - deletedmsg = 0; - msize = 0; - for (msgno = 1; msgno <= imap_le_struct->imap_stream->nmsgs; msgno++) { MESSAGECACHE * cache = mail_elt (imap_le_struct->imap_stream, msgno); mail_fetchstructure (imap_le_struct->imap_stream, msgno, NIL); diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h index b4b4360860e..c8e85de19b8 100644 --- a/ext/imap/php_imap.h +++ b/ext/imap/php_imap.h @@ -35,6 +35,21 @@ #if HAVE_IMAP #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) + + /* For now these appear on Windows, remove this check if it appears outside */ +# ifdef PHP_WIN32 + /* Undefine these LOG defines to avoid warnings */ +# undef LOG_EMERG +# undef LOG_CRIT +# undef LOG_ERR +# undef LOG_WARNING +# undef LOG_NOTICE +# undef LOG_DEBUG + + /* c-client also redefines its own ftruncate */ +# undef ftruncate +# endif + /* these are used for quota support */ # include "c-client.h" /* includes mail.h and rfc822.h */ # include "imap4r1.h" /* location of c-client quota functions */ diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 5b07951c63e..9779afaa366 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -826,6 +826,10 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec #ifdef HAVE_PCRE_JIT_SUPPORT if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) && no_utf_check && !g_notempty) { + if (start_offset < 0 || start_offset > subject_len) { + pcre_handle_exec_error(PCRE_ERROR_BADOFFSET); + break; + } count = pcre_jit_exec(pce->re, extra, subject, (int)subject_len, (int)start_offset, no_utf_check|g_notempty, offsets, size_offsets, jit_stack); } else diff --git a/ext/pcre/tests/bug74873.phpt b/ext/pcre/tests/bug74873.phpt new file mode 100644 index 00000000000..9b64dae926f --- /dev/null +++ b/ext/pcre/tests/bug74873.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()) +--FILE-- + +--EXPECT-- +bool(false) \ No newline at end of file diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 7b3cbb522c7..3b45d6507fb 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3389,7 +3389,7 @@ function check_binary_tools_sdk() /* Basic test, extend by need. */ if (BIN_TOOLS_SDK_VER_MAJOR < 2) { - ERROR("Incompatible binary tools version. Please consult https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2"); + ERROR("Incompatible binary tools version. Please consult\r\nhttps://wiki.php.net/internals/windows/stepbystepbuild_sdk_2"); } }