Simple counting bug, caught by glibc's overflow detection. We originally 
stumbled over this in 5.3.0.1, where I tested this fix, but the forward port to 
svn head was trivial, so I've not retested there. INET^_ADDRSTRLEN is only long 
enough for the address itself, the rest of the string needs to be accounted for 
seperately, that's 18 characters by my math, not 8. (I'm assuming 5 chars max 
for port number.) This code would work if you have a short address obviously, 
but when you have an address that uses most of the characters needed to 
represent it, kaboom.

--- net-snmp/snmplib/snmpUDPIPv6Domain.c.orig   2007-08-17 19:51:24.000000000 
-0500
+++ net-snmp/snmplib/snmpUDPIPv6Domain.c        2007-08-17 19:52:03.000000000 
-0500
@@ -110,7 +110,7 @@ netsnmp_udp6_fmtaddr(netsnmp_transport *
          return strdup("UDP/IPv6: unknown");
      } else {
          char addr[INET6_ADDRSTRLEN];
-        char tmp[INET6_ADDRSTRLEN + 8];
+        char tmp[INET6_ADDRSTRLEN + 18];

          sprintf(tmp, "UDP/IPv6: [%s]:%hu",
                  inet_ntop(AF_INET6, (void *) &(to->sin6_addr), addr,



-- 
6OB/7T -=- LTC Embedded Linux -=- Customer Architect and Cat Herder
Cube: 025-3/B207 -=- TieLine: 553.5061 -=- Extern: 507.253.5061
Notes: Christopher Abbey/Rochester/IBM -=- Net: [EMAIL PROTECTED]

The value of Open Standards is only evident to Open Minds.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to