diff options
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index a94ab2a..14b7c09 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -143,6 +143,11 @@ int sp_log_request(const zend_string* folder, const zend_string* text_repr, | |||
| 143 | 143 | ||
| 144 | static char* zend_string_to_char(const zend_string* zs) { | 144 | static char* zend_string_to_char(const zend_string* zs) { |
| 145 | // Remove \0 from the middle of a string | 145 | // Remove \0 from the middle of a string |
| 146 | |||
| 147 | if (ZSTR_LEN(zs) + 1 < ZSTR_LEN(zs)) { | ||
| 148 | sp_log_err("overflow_error", "Overflow tentative detected in zend_string_to_char."); | ||
| 149 | sp_terminate(); | ||
| 150 | } | ||
| 146 | char* copy = emalloc(ZSTR_LEN(zs) + 1); | 151 | char* copy = emalloc(ZSTR_LEN(zs) + 1); |
| 147 | 152 | ||
| 148 | copy[ZSTR_LEN(zs)] = 0; | 153 | copy[ZSTR_LEN(zs)] = 0; |
