提交 dc300133 authored 作者: Travis Cross's avatar Travis Cross

fix buffer length calculation in call to generate_m

This error was causing us to call generate_m with a buffer length that
was less than the strlen of the buffer we were passing.  The result
was truncated local SDP which would cause sofia to fail if the
truncation was in a particularly bad place.

Thanks to Anthony Minessale for the fix and working with me to
diagnose the issue.

FS-4293 --resolve
上级 9c463fdb
...@@ -621,7 +621,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch ...@@ -621,7 +621,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
cur_ptime = this_ptime; cur_ptime = this_ptime;
if ((!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE))) { if ((!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE))) {
generate_m(tech_pvt, buf, sizeof(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 1); generate_m(tech_pvt, bp, sizeof(buf) - strlen(buf), port, cur_ptime, append_audio, sr, use_cng, cng_type, map, verbose_sdp, 1);
bp = (buf + strlen(buf)); bp = (buf + strlen(buf));
/* asterisk can't handle AVP and SAVP in sep streams, way to blow off the spec....*/ /* asterisk can't handle AVP and SAVP in sep streams, way to blow off the spec....*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论