Skip to content

Commit 1aea0f4

Browse files
committed
Merge branch 'master' of https://git.php.net/repository/php-src
2 parents 794a288 + 1cdee9a commit 1aea0f4

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Zend/zend_operators.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ ZEND_API zend_uchar _is_numeric_string_ex(const char *str, size_t length, zend_l
9090
ZEND_API const char* zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, char *end);
9191
ZEND_API const char* zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, char *end);
9292

93-
END_EXTERN_C()
94-
9593
#if SIZEOF_ZEND_LONG == 4
9694
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > ZEND_LONG_MAX || (d) < ZEND_LONG_MIN))
9795
#else
@@ -234,7 +232,6 @@ zend_memnrstr(const char *haystack, const char *needle, size_t needle_len, char
234232
}
235233
}
236234

237-
BEGIN_EXTERN_C()
238235
ZEND_API int increment_function(zval *op1);
239236
ZEND_API int decrement_function(zval *op2);
240237

ext/pcre/php_pcre.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
12211221
new_len = result_len + subject_len - start_offset;
12221222
if (new_len > alloc_len) {
12231223
alloc_len = new_len; /* now we know exactly how long it is */
1224-
result = zend_string_realloc(result, alloc_len, 0);
1224+
if (NULL != result) {
1225+
result = zend_string_realloc(result, alloc_len, 0);
1226+
} else {
1227+
result = zend_string_alloc(alloc_len, 0);
1228+
}
12251229
}
12261230
/* stick that last bit of string on our output */
12271231
memcpy(&result->val[result_len], piece, subject_len - start_offset);

ext/standard/tests/mail/bug69115.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #69115 crash in mail (plus indirect pcre test)
3+
--FILE--
4+
<?php
5+
/* Just ensure it doesn't crash when trimming headers */
6+
$message = "Line 1\r\nLine 2\r\nLine 3";
7+
mail('caffeinated@not-ever-reached-example.com', 'My Subject', $message, "From: me@me.me");
8+
?>
9+
===DONE===
10+
--EXPECTF--
11+
%A
12+
===DONE===

win32/sendmail.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
292292
efree(RPath);
293293
}
294294
if (headers) {
295-
efree(headers);
296295
efree(headers_lc);
297296
}
298297
/* 128 is safe here, the specifier in snprintf isn't longer than that */

0 commit comments

Comments
 (0)