summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>1999-12-16 07:46:51 +0000
committerderaadt <>1999-12-16 07:46:51 +0000
commitac10646d45729b02230d6ba16729bb91850b3186 (patch)
treec26d1790d0fcd967f4e5a66a6c510d8958768644
parentd832d2ee595aa1ec704aa82dedee979c208efdfa (diff)
downloadopenbsd-ac10646d45729b02230d6ba16729bb91850b3186.tar.gz
openbsd-ac10646d45729b02230d6ba16729bb91850b3186.tar.bz2
openbsd-ac10646d45729b02230d6ba16729bb91850b3186.zip
incorrect bounds on strlcpy()
-rw-r--r--src/lib/libc/net/if_indextoname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/if_indextoname.c b/src/lib/libc/net/if_indextoname.c
index b05e82e9ff..0b71010ace 100644
--- a/src/lib/libc/net/if_indextoname.c
+++ b/src/lib/libc/net/if_indextoname.c
@@ -111,7 +111,7 @@ if_indextoname(unsigned int index, char *name)
111 struct sockaddr_dl *sd = p; 111 struct sockaddr_dl *sd = p;
112 112
113 if (sd->sdl_index == index) { 113 if (sd->sdl_index == index) {
114 strlcpy(name, lastname, sizeof(name)); 114 strlcpy(name, lastname, IFNAMSIZ);
115 retname = name; 115 retname = name;
116 goto ret; 116 goto ret;
117 } 117 }
@@ -127,7 +127,7 @@ if_indextoname(unsigned int index, char *name)
127 strlcpy(iname, lastname, sizeof(iname)); 127 strlcpy(iname, lastname, sizeof(iname));
128 128
129 if (iname[0]) { 129 if (iname[0]) {
130 strlcpy(name, iname, sizeof(name)); 130 strlcpy(name, iname, IFNAMSIZ);
131 retname = name; 131 retname = name;
132 } 132 }
133ret: 133ret: