From: Maurizio Lombardi Date: Wed, 5 Feb 2014 15:46:56 +0000 (+0100) Subject: wlags49_h2: Fix overflow in wireless_set_essid() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b89db36b3ab7c4b99027873e1de4be8d07387d4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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. Signed-off-by: Maurizio Lombardi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index 4a1ddaf5e00f..187fc060de26 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c @@ -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; }