From e431881b7b9a27d5891dbcdd4dc0af7cb544b802 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 14 Feb 2006 23:19:40 +0000 Subject: fix off by one malloc sizes Submitted by: Michal Mertl MFC after: 1 week --- sbin/ifconfig/ifieee80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin/ifconfig/ifieee80211.c') diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 5b4e2d5..77bc6a7 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -475,7 +475,7 @@ set80211bssid(const char *val, int d, int s, const struct afswtch *rafp) char *temp; struct sockaddr_dl sdl; - temp = malloc(strlen(val) + 2); + temp = malloc(strlen(val) + 2); /* ':' and '\0' */ if (temp == NULL) errx(1, "malloc failed"); temp[0] = ':'; @@ -601,7 +601,7 @@ set80211macmac(int s, int op, const char *val) char *temp; struct sockaddr_dl sdl; - temp = malloc(strlen(val) + 1); + temp = malloc(strlen(val) + 2); /* ':' and '\0' */ if (temp == NULL) errx(1, "malloc failed"); temp[0] = ':'; @@ -633,7 +633,7 @@ DECL_CMD_FUNC(set80211kickmac, val, d) struct sockaddr_dl sdl; struct ieee80211req_mlme mlme; - temp = malloc(strlen(val) + 1); + temp = malloc(strlen(val) + 2); /* ':' and '\0' */ if (temp == NULL) errx(1, "malloc failed"); temp[0] = ':'; -- cgit v1.1