< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] DnsUtil::canonicalizeIpV6Address() asserts


Hi!

I have run into the next assert in case somebody sends an incorrect IPv6 
address in a REGISTER message.

Here is the backtrace I get:
#0  0x425f77c1 in kill () from /lib/libc.so.6
#1  0x42709771 in pthread_kill () from /lib/libpthread.so.0
#2  0x42709a7b in raise () from /lib/libpthread.so.0
#3  0x425f7554 in raise () from /lib/libc.so.6
#4  0x425f8a88 in abort () from /lib/libc.so.6
#5  0x425f0bbf in __assert_fail () from /lib/libc.so.6
#6  0x40489ab4 in resip::DnsUtil::canonicalizeIpV6Address () 
from /usr/local/tequet/lib/librutil.so
#7  0x403dda39 in resip::Uri::parse () 
from /usr/local/tequet/lib/libresip.so
#8  0x402f4eb3 in resip::NameAddr::parse () 
from /usr/local/tequet/lib/libresip.so
#9  0x4033a8a6 in resip::LazyParser::checkParsed () 
from /usr/local/tequet/lib/libresip.so
#10 0x402f4d04 in resip::NameAddr::uri () 
from /usr/local/tequet/lib/libresip.so

I believe the next patch is the correct fix:
Index: resip/stack/Uri.cxx
===================================================================
--- resip/stack/Uri.cxx (revision 6543)
+++ resip/stack/Uri.cxx (working copy)
@@ -802,7 +802,8 @@
       start = pb.skipChar();
       pb.skipToChar(']');
       pb.data(mHost, start);
-      DnsUtil::canonicalizeIpV6Address(mHost);
+      if (DnsUtil::isIpV6Address(mHost))
+         DnsUtil::canonicalizeIpV6Address(mHost);
       pb.skipChar();
    }
    else

Please apply the patch or fix it in any other way.

Thanks,
Zsolt