[asterisk-commits] mjordan: trunk r430841 - in /trunk: ./ main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 21 07:06:16 CST 2015


Author: mjordan
Date: Wed Jan 21 07:06:06 2015
New Revision: 430841

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430841
Log:
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

Modified:
    trunk/   (props changed)
    trunk/main/rtp_engine.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=430841&r1=430840&r2=430841
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Wed Jan 21 07:06:06 2015
@@ -1947,8 +1947,8 @@
 	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,




More information about the asterisk-commits mailing list