incorrect bounds-check on snprintf.
Submitted by: fenner
This commit is contained in:
parent
e0ef368436
commit
b954a75e3c
@ -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 New Issue
Block a user