summaryrefslogtreecommitdiff
path: root/src/sp_utils.c
diff options
context:
space:
mode:
authorRemi Collet2018-09-03 15:38:51 +0200
committerjvoisin2018-09-03 13:38:51 +0000
commit499a81914597f156fe9a67e47e3baf82a0af4bde (patch)
tree23630733f4b892d362217cb5c8840d268d03c7c1 /src/sp_utils.c
parentc947eb5378f894b154bdd33588f4bfb470075fe8 (diff)
Fix #241 segfault on 32-bit related to bad protype (#242)
This should close #241
Diffstat (limited to 'src/sp_utils.c')
-rw-r--r--src/sp_utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c
index 970f314..8a3874c 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -287,7 +287,7 @@ bool sp_match_array_key(const zval* zv, const zend_string* to_match,
287 } 287 }
288 } else { 288 } else {
289 char* idx_str = NULL; 289 char* idx_str = NULL;
290 spprintf(&idx_str, 0, "%lu", idx); 290 spprintf(&idx_str, 0, ZEND_ULONG_FMT, idx);
291 zend_string* tmp = zend_string_init(idx_str, strlen(idx_str), 0); 291 zend_string* tmp = zend_string_init(idx_str, strlen(idx_str), 0);
292 if (sp_match_value(tmp, to_match, rx)) { 292 if (sp_match_value(tmp, to_match, rx)) {
293 efree(idx_str); 293 efree(idx_str);
@@ -320,7 +320,7 @@ bool sp_match_array_value(const zval* arr, const zend_string* to_match,
320} 320}
321 321
322int hook_function(const char* original_name, HashTable* hook_table, 322int hook_function(const char* original_name, HashTable* hook_table,
323 void (*new_function)(INTERNAL_FUNCTION_PARAMETERS)) { 323 zif_handler new_function) {
324 zend_internal_function* func; 324 zend_internal_function* func;
325 bool ret = FAILURE; 325 bool ret = FAILURE;
326 326
@@ -363,7 +363,7 @@ int hook_function(const char* original_name, HashTable* hook_table,
363} 363}
364 364
365int hook_regexp(const sp_pcre* regexp, HashTable* hook_table, 365int hook_regexp(const sp_pcre* regexp, HashTable* hook_table,
366 void (*new_function)(INTERNAL_FUNCTION_PARAMETERS)) { 366 zif_handler new_function) {
367 zend_string* key; 367 zend_string* key;
368 368
369 ZEND_HASH_FOREACH_STR_KEY(CG(function_table), key) 369 ZEND_HASH_FOREACH_STR_KEY(CG(function_table), key)