Fix TSRM build

This commit is contained in:
Stanislav Malyshev 2016-08-16 16:34:35 -07:00
parent 35a8ed2f62
commit 40bd921cea
2 changed files with 2 additions and 0 deletions

View file

@ -67,6 +67,7 @@ PHPAPI unsigned char *php_base64_encode(const unsigned char *str, int length, in
}
if (((size_t)length + 2) / 3 > INT_MAX/4 ) {
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, maximum is %d", INT_MAX/4);
return NULL;
}

View file

@ -522,6 +522,7 @@ PHPAPI char *php_url_encode(char const *s, int len, int *new_length)
}
if ((to-start) > INT_MAX) {
TSRMLS_FETCH();
/* E_ERROR since most clients won't check for error, and this is rather rare condition */
php_error_docref(NULL TSRMLS_CC, E_ERROR, "String overflow, max length is %d", INT_MAX);
}