From: Olle Johansson Date: Wed, 5 Apr 2006 06:52:41 +0000 (+0000) Subject: Issue #6654: Enum crash on ADDRESS record, possibly bad record, but still a crash... X-Git-Tag: 1.4.0-beta1~2146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b27966e7127370aadfe21e079d918958a6302c1;p=thirdparty%2Fasterisk.git Issue #6654: Enum crash on ADDRESS record, possibly bad record, but still a crash (imported from 1.2) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17490 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/CREDITS b/CREDITS index 8661295505..809e7b44e3 100644 --- a/CREDITS +++ b/CREDITS @@ -13,6 +13,8 @@ Telesthetic - for supporting SIP development Christos Ricudis - for substantial code contributions +nic.at - ENUM support in Asterisk + Paul Bagyenda, Digital Solutions - for initial Voicetronix driver development === WISHLIST CONTRIBUTERS === diff --git a/enum.c b/enum.c index 242c5b355c..96e0702ebe 100644 --- a/enum.c +++ b/enum.c @@ -99,8 +99,8 @@ static int parse_ie(char *data, int maxdatalen, char *src, int srclen) len = olen = (int)src[0]; src++; srclen--; - if (len > srclen) { - ast_log(LOG_WARNING, "Want %d, got %d\n", len, srclen); + if (len > srclen || len < 0 ) { + ast_log(LOG_WARNING, "ENUM parsing failed: Wanted %d characters, got %d\n", len, srclen); return -1; } if (len > maxdatalen)