Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory overflow and capacity regression. #727

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions srtp/srtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4899,8 +4899,7 @@ srtp_err_status_t srtp_stream_list_insert(srtp_stream_list_t list,
size_t new_capacity = list->capacity * 2;

// check for capacity overflow.
if ((sizeof(list_entry) * new_capacity) <=
(sizeof(list_entry) * list->capacity)) {
if (new_capacity < list->capacity || new_capacity > SIZE_MAX / sizeof(list_entry)) {
return srtp_err_status_alloc_fail;
}

Expand Down
Loading