Skip to content

Commit

Permalink
check length first, prevent out-of-bounds read
Browse files Browse the repository at this point in the history
  • Loading branch information
tony2001 committed Feb 3, 2016
1 parent 6832725 commit 64e8cfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/session/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,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);
Expand Down

0 comments on commit 64e8cfa

Please sign in to comment.