summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 15:19:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 15:19:41 +0000
commit6ebd04219f0d749c87a763e8afb578dfcd5223cc (patch)
treebb0f29e0a3791fff88551c93f5d4ba7113bdba43 /usr.sbin/ppp
parentbe524287dc216d876f995eddcaf32762c702c6e9 (diff)
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/ppp/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/route.c b/usr.sbin/ppp/ppp/route.c
index b045ee693a6..703842d0389 100644
--- a/usr.sbin/ppp/ppp/route.c
+++ b/usr.sbin/ppp/ppp/route.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: route.c,v 1.34 2005/07/17 20:43:14 brad Exp $
+ * $OpenBSD: route.c,v 1.35 2007/09/02 15:19:39 deraadt Exp $
*/
#include <sys/param.h>
@@ -262,7 +262,7 @@ Index2Nam(int idx)
if (had)
newifs = (char **)realloc(ifs, sizeof(char *) * have);
else
- newifs = (char **)malloc(sizeof(char *) * have);
+ newifs = (char **)calloc(sizeof(char *), have);
if (!newifs) {
log_Printf(LogDEBUG, "Index2Nam: %s\n", strerror(errno));
route_nifs = 0;