Permalink
Browse files

memset required as we check ifr.if_name[siz - 1] is 0 or not

  • Loading branch information...
1 parent f26a95d commit 0281b0a7cba4881fbd99da451e9f9d6ab9d6f0d0 itojun committed Mar 11, 2005
Showing with 2 additions and 1 deletion.
  1. +2 −1 kame/kame/libinet6/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $KAME: getaddrinfo.c,v 1.213 2005/03/02 05:22:52 suz Exp $ */
+/* $KAME: getaddrinfo.c,v 1.214 2005/03/11 14:22:35 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -798,6 +798,7 @@ init(ac, flags)
/* reject certain types of addresses */
s = socket(sa6->sin6_family, SOCK_DGRAM, 0);
if (s >= 0) {
+ memset(&ifr6, 0, sizeof(ifr6));
strncpy(ifr6.ifr_name, ifap->ifa_name,
sizeof(ifr6.ifr_name));
if (ifr6.ifr_name[sizeof(ifr6.ifr_name) - 1]

0 comments on commit 0281b0a

Please sign in to comment.