Avoid overruns when copying the interface name.
This commit is contained in:
parent
a9972e1bbb
commit
029f35aa10
@ -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
|
||||
@ -131,7 +131,9 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
|
||||
if ((error = copyin(data, &sr, sizeof(sr))) != 0)
|
||||
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,
|
||||
(caddr_t) &br, p)) != 0) {
|
||||
DPRINTF(("SIOCGIFFLAGS %s: error %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user