summaryrefslogtreecommitdiff
path: root/src/sp_utils.c
diff options
context:
space:
mode:
authorjvoisin2017-10-13 12:28:30 +0200
committerjvoisin2017-10-13 12:28:30 +0200
commitdc64bf47277377460ac0cef60458a57f7fbb6743 (patch)
treee17fabedc6a9d723383a6c5788787b8536e5c37e /src/sp_utils.c
parentaf7d8bb0d41f81709db920efaacf48d69294f2a7 (diff)
Fix the size of the output vector in our usage of pcre
Diffstat (limited to 'src/sp_utils.c')
-rw-r--r--src/sp_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c
index e0c36d0..faf2e9a 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -48,7 +48,8 @@ zend_always_inline int is_regexp_matching(const pcre* regexp, const char* str) {
48 return false; 48 return false;
49 } 49 }
50 50
51 ret = sp_pcre_exec(regexp, NULL, str, strlen(str), 0, 0, vec, sizeof(vec)); 51 ret = sp_pcre_exec(regexp, NULL, str, strlen(str), 0, 0, vec,
52 sizeof(vec)/sizeof(int));
52 53
53 if (ret < 0) { 54 if (ret < 0) {
54 if (ret != PCRE_ERROR_NOMATCH) { 55 if (ret != PCRE_ERROR_NOMATCH) {
@@ -427,7 +428,8 @@ int hook_regexp(const pcre* regexp, HashTable* hook_table,
427 ZEND_HASH_FOREACH_STR_KEY(ht, key) { 428 ZEND_HASH_FOREACH_STR_KEY(ht, key) {
428 if (key) { 429 if (key) {
429 int vec[30]; 430 int vec[30];
430 int ret = sp_pcre_exec(regexp, NULL, key->val, key->len, 0, 0, vec, 30); 431 int ret = sp_pcre_exec(regexp, NULL, key->val, key->len, 0, 0, vec,
432 sizeof(vec)/sizeof(int));
431 if (ret < 0) { /* Error or no match*/ 433 if (ret < 0) { /* Error or no match*/
432 if (PCRE_ERROR_NOMATCH != ret) { 434 if (PCRE_ERROR_NOMATCH != ret) {
433 sp_log_err("pcre", "Runtime error with pcre, error code: %d", ret); 435 sp_log_err("pcre", "Runtime error with pcre, error code: %d", ret);