summaryrefslogtreecommitdiff
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorpaul <paul>2003-05-24 11:50:50 +0000
committerpaul <paul>2003-05-24 11:50:50 +0000
commit239a6718bac2fbad61cdd2fb3dc147d51c527b62 (patch)
tree073132fd3a2561f6c45d6f5bc0a33611fb2f4ff1 /lib/sockunion.c
parent034489dee713322f20304f022dd371f8d6821598 (diff)
Fix incorrect buffer bounds.
Reported by Anil Madhavapeddy to bug-zebra.
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 21371624..13b0be6b 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -302,16 +302,16 @@ sockunion_log (union sockunion *su)
switch (su->sa.sa_family)
{
case AF_INET:
- snprintf (buf, BUFSIZ, "%s", inet_ntoa (su->sin.sin_addr));
+ snprintf (buf, SU_ADDRSTRLEN, "%s", inet_ntoa (su->sin.sin_addr));
break;
#ifdef HAVE_IPV6
case AF_INET6:
- snprintf (buf, BUFSIZ, "%s",
- inet_ntop (AF_INET6, &(su->sin6.sin6_addr), buf, BUFSIZ));
+ snprintf (buf, SU_ADDRSTRLEN, "%s",
+ inet_ntop (AF_INET6, &(su->sin6.sin6_addr), buf, SU_ADDRSTRLEN));
break;
#endif /* HAVE_IPV6 */
default:
- snprintf (buf, BUFSIZ, "af_unknown %d ", su->sa.sa_family);
+ snprintf (buf, SU_ADDRSTRLEN, "af_unknown %d ", su->sa.sa_family);
break;
}
return buf;