Skip to content

Commit 978879d

Browse files
committed
check for capacity overflow, cont.
1 parent e23bd13 commit 978879d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

srtp/srtp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4912,7 +4912,8 @@ srtp_err_status_t srtp_stream_list_insert(srtp_stream_list_t list,
49124912
size_t new_capacity = list->capacity + ((list->capacity + 1u) / 2u);
49134913

49144914
// check for capacity overflow.
4915-
if (new_capacity <= list->capacity) {
4915+
if ((sizeof(list_entry) * new_capacity) <=
4916+
(sizeof(list_entry) * list->capacity)) {
49164917
return srtp_err_status_alloc_fail;
49174918
}
49184919

0 commit comments

Comments
 (0)