From: Michael Jerris Date: Wed, 27 May 2015 22:14:49 +0000 (-0400) Subject: CID:1301145,1301144: Bit shift bounds checking X-Git-Tag: v1.6.2~614^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfbbc6742f0491c7e805438c38784f976ba58c2;p=thirdparty%2Ffreeswitch.git CID:1301145,1301144: Bit shift bounds checking --- diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 630d843911..438a3dabd5 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1845,9 +1845,11 @@ static void calc_bw_exp(uint32_t bps, uint8_t bits, rtcp_tmmbx_t *tmmbx) uint32_t mantissa = 0; uint16_t overhead = 60; + switch_assert(bits<=32); + mantissa_max = (1 << bits) - 1; - for (i = 0; i < 64; ++i) { + for (i = 0; i < 32; ++i) { if (bps <= (mantissa_max << i)) { exp = i; break;