Improve fix for bug #81740

This commit is contained in:
Stanislav Malyshev 2022-12-18 23:20:29 -07:00
parent 5975f33c37
commit a6a80eefe0
3 changed files with 17 additions and 4 deletions

View file

@ -227,8 +227,8 @@ static zend_string *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const zend_string
static zend_string* sqlite_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param_type paramtype)
{
char *quoted;
if (unquotedlen > (INT_MAX - 3) / 2) {
return 0;
if (ZSTR_LEN(unquoted) > (INT_MAX - 3) / 2) {
return NULL;
}
quoted = safe_emalloc(2, ZSTR_LEN(unquoted), 3);
/* TODO use %Q format? */