<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10148">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">rtp_engine: rtcp_report_to_json can overflow the ssrc integer value<br><br>When writing an RTCP report to json the code attempts to pack the "ssrc" and<br>"source_ssrc" unsigned integer values as a signed int value type. This of course<br>means if the ssrc's unsigned value is greater than that which can fit into a<br>signed integer value it gets converted to a negative number. Subsequently, the<br>negative value goes out in the json report.<br><br>This patch now packs the value as a json_int_t, which is the widest integer type<br>available on a given system. This should make it so the value no longer<br>overflows.<br><br>Note, this was caught by two failing tests hep/rtcp-receiver/ and<br>hep/rtcp-sender.<br><br>Change-Id: I2af275286ee5e795b79f0c3d450d9e4b28e958b0<br>---<br>M main/rtp_engine.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/10148/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/rtp_engine.c b/main/rtp_engine.c</span><br><span>index 3d50774..a6ee9d5 100644</span><br><span>--- a/main/rtp_engine.c</span><br><span>+++ b/main/rtp_engine.c</span><br><span>@@ -3379,7 +3379,7 @@</span><br><span>           char str_lsr[32];</span><br><span> </span><br><span>                snprintf(str_lsr, sizeof(str_lsr), "%u", payload->report->report_block[i]->lsr);</span><br><span style="color: hsl(0, 100%, 40%);">-             json_report_block = ast_json_pack("{s: i, s: i, s: i, s: i, s: i, s: s, s: i}",</span><br><span style="color: hsl(120, 100%, 40%);">+             json_report_block = ast_json_pack("{s: I, s: i, s: i, s: i, s: i, s: s, s: i}",</span><br><span>                    "source_ssrc", payload->report->report_block[i]->source_ssrc,</span><br><span>                     "fraction_lost", payload->report->report_block[i]->lost_count.fraction,</span><br><span>                   "packets_lost", payload->report->report_block[i]->lost_count.packets,</span><br><span>@@ -3412,7 +3412,7 @@</span><br><span>             }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   json_rtcp_report = ast_json_pack("{s: i, s: i, s: i, s: o, s: o}",</span><br><span style="color: hsl(120, 100%, 40%);">+  json_rtcp_report = ast_json_pack("{s: I, s: i, s: i, s: o, s: o}",</span><br><span>                 "ssrc", payload->report->ssrc,</span><br><span>               "type", payload->report->type,</span><br><span>               "report_count", payload->report->reception_report_count,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10148">change 10148</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10148"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I2af275286ee5e795b79f0c3d450d9e4b28e958b0 </div>
<div style="display:none"> Gerrit-Change-Number: 10148 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>