From 49b002eae97659e1ffc06fd7d49a1413b6a8296c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Feb 2008 08:22:00 +0100 Subject: [PATCH] Fix ESSID parsing on 64-bit architectures --- plugins/80211.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/80211.c b/plugins/80211.c index 53b36b6..0434b8c 100644 --- a/plugins/80211.c +++ b/plugins/80211.c @@ -366,11 +366,12 @@ static void parse_scan_results(struct connman_iface *iface, break; case SIOCGIWESSID: if (station != NULL) { - station->name = malloc(event->len - 7); + station->name = malloc(event->len - IW_EV_POINT_LEN + 1); if (station->name != NULL) { - memset(station->name, 0, event->len - 7); - memcpy(station->name, ptr + 8, - event->len - 8); + memset(station->name, 0, + event->len - IW_EV_POINT_LEN + 1); + memcpy(station->name, ptr + IW_EV_POINT_LEN, + event->len - IW_EV_POINT_LEN); } } break; @@ -462,7 +463,7 @@ static void iface_scan_results(struct connman_iface *iface) done = 1; } else { parse_scan_results(iface, iwr.u.data.pointer, - iwr.u.data.length); + iwr.u.data.length); done = 1; } } -- 2.7.4