Avoid overruns when copying the interface name.

This commit is contained in:
christos 1996-05-03 17:09:15 +00:00
parent a9972e1bbb
commit 029f35aa10

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_sockio.c,v 1.9 1996/04/22 01:17:33 christos Exp $ */ /* $NetBSD: svr4_sockio.c,v 1.10 1996/05/03 17:09:15 christos Exp $ */
/* /*
* Copyright (c) 1995 Christos Zoulas * Copyright (c) 1995 Christos Zoulas
@ -131,7 +131,9 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
if ((error = copyin(data, &sr, sizeof(sr))) != 0) if ((error = copyin(data, &sr, sizeof(sr))) != 0)
return error; return error;
(void) strcpy(br.ifr_name, sr.svr4_ifr_name); (void) strncpy(br.ifr_name, sr.svr4_ifr_name,
sizeof(br.ifr_name));
if ((error = (*ctl)(fp, SIOCGIFFLAGS, if ((error = (*ctl)(fp, SIOCGIFFLAGS,
(caddr_t) &br, p)) != 0) { (caddr_t) &br, p)) != 0) {
DPRINTF(("SIOCGIFFLAGS %s: error %d\n", DPRINTF(("SIOCGIFFLAGS %s: error %d\n",