Skip to content

Commit

Permalink
check for capacity overflow, cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Jan 17, 2024
1 parent e23bd13 commit 978879d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion srtp/srtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4912,7 +4912,8 @@ srtp_err_status_t srtp_stream_list_insert(srtp_stream_list_t list,
size_t new_capacity = list->capacity + ((list->capacity + 1u) / 2u);

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

Expand Down

0 comments on commit 978879d

Please sign in to comment.