From 73ef8460742d99d3eb27074e5ec48ed87a4e1eb4 Mon Sep 17 00:00:00 2001 From: itojun Date: Mon, 14 Jul 2003 08:36:34 +0000 Subject: [PATCH] use bounded string op --- common/device.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/device.c b/common/device.c index f3fe91a..05d968f 100644 --- a/common/device.c +++ b/common/device.c @@ -1,4 +1,4 @@ -/* $NetBSD: device.c,v 1.6 2003/04/20 00:17:22 christos Exp $ */ +/* $NetBSD: device.c,v 1.7 2003/07/14 08:37:53 itojun Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: device.c,v 1.6 2003/04/20 00:17:22 christos Exp $"); +__RCSID("$NetBSD: device.c,v 1.7 2003/07/14 08:37:53 itojun Exp $"); #endif #include "os.h" @@ -118,7 +118,6 @@ deviceOpen(ifname, proto, trans) } if (tmp.fd != -1) { - p = (struct if_info *)malloc(sizeof(*p)); if (p == 0) mopLogErr("deviceOpen: malloc"); @@ -126,7 +125,7 @@ deviceOpen(ifname, proto, trans) p->next = iflist; iflist = p; - strcpy(p->if_name,tmp.if_name); + strlcpy(p->if_name, tmp.if_name, sizeof(p->if_name)); p->iopen = tmp.iopen; p->write = pfWrite; p->read = tmp.read;