summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2006-02-14 23:19:40 +0000
committersam <sam@FreeBSD.org>2006-02-14 23:19:40 +0000
commite431881b7b9a27d5891dbcdd4dc0af7cb544b802 (patch)
tree9191d91821d089794555d86acde9befd4d7ca53f /sbin
parentbb2e6821fa4d244753361cc3b57242a8bda4907d (diff)
downloadFreeBSD-src-e431881b7b9a27d5891dbcdd4dc0af7cb544b802.zip
FreeBSD-src-e431881b7b9a27d5891dbcdd4dc0af7cb544b802.tar.gz
fix off by one malloc sizes
Submitted by: Michal Mertl MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifieee80211.c6
1 files changed, 3 insertions, 3 deletions
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] = ':';
OpenPOWER on IntegriCloud