libsrtp icon indicating copy to clipboard operation
libsrtp copied to clipboard

bug in srtp_remove_stream

Open fluffy opened this issue 13 years ago • 1 comments

http://sourceforge.net/tracker/?func=detail&aid=2192597&group_id=38894&atid=423799

I found a bug in srtp_remove_stream.

This: /* remove stream from the list */ last_stream->next = stream->next;

Does not work if there is only one stream in the list. You need something like: /* remove stream from the list */ if (last_stream == stream){ // only one stream in list session->stream_list = stream->next; } else { last_stream->next = stream->next; }

The following pseudo-code uncovered this problem: srtp_t srtpSession; srtp_policy_t srtpPolicy; srtp_init(); srtp_create(&srtpSession, NULL); srtp_add_stream(srtpSession, &srtpPolicy); srtp_remove_stream(srtpSession, the_ssrc); srtp_dealloc(srtpSession); Memory fault

fluffy avatar Mar 28 '13 23:03 fluffy

Looks like this is already in head. This can be closed.

tvsriram avatar May 22 '13 22:05 tvsriram