Commit 9546e959 authored by Pascal Buhler's avatar Pascal Buhler
Browse files

Prevent OOB access of stream_template->session_keys

The template may not have been used for the deallocated
stream, therefore the size of the session_keys array
could be different.

Should maybe contain a pointer to template from stream
so it is explicitly known that it was used.
parent 8ec13a7e
......@@ -164,7 +164,8 @@ srtp_err_status_t srtp_stream_dealloc(srtp_stream_ctx_t *stream,
for (i = 0; i < stream->num_master_keys; i++) {
session_keys = &stream->session_keys[i];
if (stream_template) {
if (stream_template &&
stream->num_master_keys == stream_template->num_master_keys) {
template_session_keys = &stream_template->session_keys[i];
} else {
template_session_keys = NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment