Revision: 14481
Author: adrian.chadd
Date: Wed Mar 24 07:01:56 2010
Log: fix Issue #95


http://code.google.com/p/lusca-cache/source/detail?r=14481

Modified:
 /branches/LUSCA_HEAD/libsqinet/sqinet.c

=======================================
--- /branches/LUSCA_HEAD/libsqinet/sqinet.c     Sun Apr  5 17:22:03 2009
+++ /branches/LUSCA_HEAD/libsqinet/sqinet.c     Wed Mar 24 07:01:56 2010
@@ -583,7 +583,10 @@

retval = getnameinfo((struct sockaddr *) (&s->st), sqinet_get_length(s), hoststr, hostlen, NULL, 0, NI_NUMERICHOST|NI_NUMERICSERV);
        if (! (flags & SQADDR_NO_BRACKET_V6) && s->st.ss_family == AF_INET6) {
-               hoststr[strlen(hoststr)] = ']';
+               size_t len = strlen(hoststr);
+               assert(len < hostlen - 2);   /* XXX need space for ]\0 */
+               hoststr[len] = ']';
+               hoststr[len+1] = '\0';
        }
        return (retval == 0);
 }

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to