diff options
author | Matthew Jordan <mjordan@digium.com> | 2015-01-21 13:06:06 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2015-01-21 13:06:06 +0000 |
commit | 228fdb3f4e58e37011a884847f7c488365432f11 (patch) | |
tree | 1fa85c1729d98f22dc299382a8c926e2435916ce /main/rtp_engine.c | |
parent | 804ab70f9d99192e34b2f6e74590e24e6490f114 (diff) |
main/rtp_engine: Format NTP timestamps as unsigned longs
When the RTCP reports are created, the NTP timestamps are stored as strings,
as JSON does not have an integer type long enough to store the value. However,
on 32-bit systems, a signed long may overflow for some portion of the
timestamp.
This patch corrects the overflow by formatting the timestamps as unsigned
longs.
........
Merged revisions 430840 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp_engine.c')
-rw-r--r-- | main/rtp_engine.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/rtp_engine.c b/main/rtp_engine.c index a827cfc87..962899b57 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -1947,8 +1947,8 @@ static struct ast_json *rtcp_report_to_json(struct stasis_message *msg, if (payload->report->type == AST_RTP_RTCP_SR) { char sec[32]; char usec[32]; - snprintf(sec, sizeof(sec), "%ld", payload->report->sender_information.ntp_timestamp.tv_sec); - snprintf(usec, sizeof(usec), "%ld", payload->report->sender_information.ntp_timestamp.tv_usec); + snprintf(sec, sizeof(sec), "%lu", payload->report->sender_information.ntp_timestamp.tv_sec); + snprintf(usec, sizeof(usec), "%lu", payload->report->sender_information.ntp_timestamp.tv_usec); json_rtcp_sender_info = ast_json_pack("{s: s, s: s, s: i, s: i, s: i}", "ntp_timestamp_sec", sec, "ntp_timestamp_usec", usec, |