ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ccrtp-devel] Overflow bug in outqueue.cpp


From: David Sugar
Subject: Re: [Ccrtp-devel] Overflow bug in outqueue.cpp
Date: Thu, 15 May 2008 13:06:32 -0400
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

I will make sure it gets fixed in the next release. We may do one very soon just to cover this and other small bug fixes.

Hattori Kenta wrote:
Hello

When I was debugging for our VoIP system, which is using ccRTP
library, I found a bug that causes stopping to send RTP packets.

The following code to calculate 'overflow.tv_usec' field easily causes
overflow problem.

####
   overflow.tv_usec = (~static_cast<uint32>(0)) % rate *
           1000000ul / rate;

#### in OutgoingDataQueue::getSchedulingTimeout(void)

For example, when 'rate' is 8000, we first get
0xffffffff % 8000 = 7295

then

7295 * 10000000 = 7295000000 > 4294967295 (overflow!!!)

This error is accumulated every time when a timestamp goes round.
Finally it causes packet expiration and streaming will stop.

The easiest way to fix this problem might be to use unsigned long
long as follows:

   overflow.tv_usec = (~static_cast<uint32>(0)) % rate *
           1000000ull / rate;
                 ^^^^^^

I originally found this problem in ccRTP-1.2.2, but it still remains
in the newest version.

---
Kenta Hattori(address@hidden)
Resarch Institute of Systems Planning, Inc./ISP



_______________________________________________
Ccrtp-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Attachment: dyfet.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]