From: Rickard Strandqvist Date: Sat, 9 Aug 2014 23:39:28 +0000 (+0200) Subject: net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate after strncpy... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2da2c5854ed759a64f8a9231a7f544b472c3aa6d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git net: wireless: ipw2x00: ipw2200.c: Cleaning up missing null-terminate after strncpy call Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index c5aa404069f3..389656bd1a74 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c @@ -9853,6 +9853,7 @@ static int ipw_wx_get_wireless_mode(struct net_device *dev, strncpy(extra, "unknown", MAX_WX_STRING); break; } + extra[MAX_WX_STRING - 1] = '\0'; IPW_DEBUG_WX("PRIV GET MODE: %s\n", extra);