From: David Vossel Date: Wed, 19 May 2010 20:30:33 +0000 (+0000) Subject: fixes infinite loop during udptl.c's decode_open_type X-Git-Tag: 11.0.0-beta1~3000 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e9d07156637989551f3c3df58c246135e2c007;p=thirdparty%2Fasterisk.git fixes infinite loop during udptl.c's decode_open_type When decode_length returns the length there is a check to see if that length is negative, if so the decode loop breaks as this means the limit has been reached. The problem here is that length is an unsigned int, so length can never be negative. This resulted in an infinite loop. (issue #17352) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264400 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/udptl.c b/main/udptl.c index 0e88b2b4ad..113a183c0f 100644 --- a/main/udptl.c +++ b/main/udptl.c @@ -226,8 +226,8 @@ static int decode_open_type(uint8_t *buf, unsigned int limit, unsigned int *len, { unsigned int octet_cnt; unsigned int octet_idx; - unsigned int length; unsigned int i; + int length; /* a negative length indicates the limit has been reached in decode_length. */ const uint8_t **pbuf; for (octet_idx = 0, *p_num_octets = 0; ; octet_idx += octet_cnt) {