Commit 6f6fdbed authored by Pascal Buhler's avatar Pascal Buhler

Don't access OOB in stream->session_keys

mki_index is a zero based index in the sesssion_keys
array which has a max length of num_master_keys.

Reported by Guido Vranken <guidovranken@gmail.com>
parent 5a752e26
......@@ -4614,7 +4614,7 @@ srtp_err_status_t srtp_get_protect_trailer_length(srtp_t session,
}
if (use_mki) {
if (mki_index > stream->num_master_keys)
if (mki_index >= stream->num_master_keys)
return srtp_err_status_bad_mki;
*length += stream->session_keys[mki_index].mki_size;
......@@ -4652,7 +4652,7 @@ srtp_err_status_t srtp_get_protect_rtcp_trailer_length(srtp_t session,
}
if (use_mki) {
if (mki_index > stream->num_master_keys)
if (mki_index >= stream->num_master_keys)
return srtp_err_status_bad_mki;
*length += stream->session_keys[mki_index].mki_size;
......
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