Skip to contentSkip to conversation

wlags49_h2: Fix overflow in wireless_set_essid()

PATCH RESEND New Maurizio Lombardi 1 participant 1 message Feb 5, 2014 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH RESEND 1/1 wlags49_h2: Fix overflow in wireless_set_essid()

This patch prevents the wireless_set_essid() function from overwriting the last byte of the NetworkName buffer which must be NULL.

---
 drivers/staging/wlags49_h2/wl_wext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlags49_h2/wl_wext.c +1 -1
index 4a1ddaf..187fc06 100644
@@ -1061,7 +1061,7 @@ static int wireless_set_essid(struct net_device *dev, struct iw_request_info *in
 		goto out;
 	}
 
-	if (data->flags != 0 && data->length > HCF_MAX_NAME_LEN + 1) {
+	if (data->flags != 0 && data->length > HCF_MAX_NAME_LEN) {
 		ret = -EINVAL;
 		goto out;
 	}
Signature · 1 line
Maurizio Lombardi