mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 08:44:33 +00:00
incorrect bounds-check on snprintf.
Submitted by: fenner
This commit is contained in:
parent
e0ef368436
commit
b954a75e3c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=80405
|
@ -1,5 +1,5 @@
|
|||
/* $FreeBSD$ */
|
||||
/* $KAME: net_osdep.c,v 1.9 2001/04/06 09:22:05 itojun Exp $ */
|
||||
/* $KAME: net_osdep.c,v 1.10 2001/07/26 19:08:37 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -61,7 +61,7 @@ if_name(ifp)
|
|||
ifbufround = (ifbufround + 1) % MAXNUMBUF;
|
||||
cp = nam[ifbufround];
|
||||
|
||||
snprintf(cp, sizeof(nam), "%s%d", ifp->if_name, ifp->if_unit);
|
||||
snprintf(cp, IFNAMSIZ + 10, "%s%d", ifp->if_name, ifp->if_unit);
|
||||
return((const char *)cp);
|
||||
#undef MAXNUMBUF
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue