diff options
author | Anatol Belski <ab@php.net> | 2018-07-05 17:23:47 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-07-05 17:24:38 +0200 |
commit | 0630e3bc03ba3ccb9c7ca974ebab7aaa98322444 (patch) | |
tree | d9a5351f33dd1ad4b2730195aadbcc804fcfb134 | |
parent | 169d4545931a43df258608c6cfb59b3e4bb92776 (diff) | |
download | php-git-0630e3bc03ba3ccb9c7ca974ebab7aaa98322444.tar.gz |
Reduce error buffer size
120 bytes is ample, the doc says.
-rw-r--r-- | ext/mbstring/mbstring.c | 2 | ||||
-rw-r--r-- | ext/opcache/zend_accelerator_blacklist.c | 2 | ||||
-rw-r--r-- | ext/pcre/php_pcre.c | 2 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 8a6de170dc..01c070b584 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 ed18994f85..e2b510c6cd 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 c365c9f475..7555428f42 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 1235781d98..d22b6dfc59 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; |