com php-src: Reduce error buffer size: ext/mbstring/mbstring.c ext/opcache/zend_accelerator_blacklist.c ext/pcre/php _pcre.c ext/pgsql/pgsql.c
| From: | Anatol Belski | Date: | Thu, 05 Jul 2018 15:24:38 +0000 |
| Subject: | com php-src: Reduce error buffer size: ext/mbstring/mbstring.c ext/opcache/zend_accelerator_blacklist.c ext/pcre/php _pcre.c ext/pgsql/pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102425@lists.php.net to get a copy of this message | ||
Commit: 0630e3bc03ba3ccb9c7ca974ebab7aaa98322444
Author: Anatol Belski <ab@php.net> Thu, 5 Jul 2018 17:23:47 +0200
Parents: 169d4545931a43df258608c6cfb59b3e4bb92776
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0630e3bc03ba3ccb9c7ca974ebab7aaa98322444
Log:
Reduce error buffer size
120 bytes is ample, the doc says.
Changed paths:
M ext/mbstring/mbstring.c
M ext/opcache/zend_accelerator_blacklist.c
M ext/pcre/php_pcre.c
M ext/pgsql/pgsql.c
Diff:
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 8a6de17..01c070b 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1051,7 +1051,7 @@ static void *_php_mb_compile_regex(const char *pattern)
if (!(retval = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED,
PCRE2_CASELESS, &errnum, &err_offset, php_pcre_cctx()))) {
- PCRE2_UCHAR err_str[256];
+ PCRE2_UCHAR err_str[128];
pcre2_get_error_message(errnum, err_str, sizeof(err_str));
php_error_docref(NULL, E_WARNING, "%s (offset=%zu): %s", pattern, err_offset, err_str);
}
diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c
index ed18994..e2b510c 100644
--- a/ext/opcache/zend_accelerator_blacklist.c
+++ b/ext/opcache/zend_accelerator_blacklist.c
@@ -73,7 +73,7 @@ static void blacklist_report_regexp_error(const char *pcre_error, int pcre_error
static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist)
{
- PCRE2_UCHAR pcre_error[256];
+ PCRE2_UCHAR pcre_error[128];
int i, errnumber;
PCRE2_SIZE pcre_error_offset;
zend_regexp_list **regexp_list_it, *it;
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index c365c9f..7555428 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -534,7 +534,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
pcre2_code *re = NULL;
uint32_t coptions = 0;
uint32_t extra_coptions = PHP_PCRE_DEFAULT_EXTRA_COPTIONS;
- PCRE2_UCHAR error[256];
+ PCRE2_UCHAR error[128];
PCRE2_SIZE erroffset;
int errnumber;
char delimiter;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 1235781..d22b6df 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -5759,7 +5759,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char
*
re = pcre2_compile((PCRE2_SPTR)regex, regex_len, options, &errnumber, &err_offset,
php_pcre_cctx());
if (NULL == re) {
- PCRE2_UCHAR err_msg[256];
+ PCRE2_UCHAR err_msg[128];
pcre2_get_error_message(errnumber, err_msg, sizeof(err_msg));
php_error_docref(NULL, E_WARNING, "Cannot compile regex: '%s'", err_msg);
return FAILURE;