mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
check length first, prevent out-of-bounds read
This commit is contained in:
parent
5154a48d37
commit
6f81e95c33
@ -2942,7 +2942,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
|
||||
if (name_len == progress->sname_len && memcmp(data->name, PS(session_name), name_len) == 0) {
|
||||
zval_dtor(&progress->sid);
|
||||
ZVAL_STRINGL(&progress->sid, (*data->value), value_len);
|
||||
} else if (memcmp(data->name, PS(rfc1867_name), name_len + 1) == 0) {
|
||||
} else if (name_len == strlen(PS(rfc1867_name)) && memcmp(data->name, PS(rfc1867_name), name_len + 1) == 0) {
|
||||
smart_str_free(&progress->key);
|
||||
smart_str_appends(&progress->key, PS(rfc1867_prefix));
|
||||
smart_str_appendl(&progress->key, *data->value, value_len);
|
||||
|
Loading…
Reference in New Issue
Block a user