From: Peter Huewe Date: Thu, 14 Feb 2013 03:08:55 +0000 (+0100) Subject: staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c X-Git-Tag: v3.9-rc1~127^2~45 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67a88e6390e52e42b72342a88fab458ada00ba28;p=pandora-kernel.git staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c Clang/scan-build complains about a possible buffer overflow in ieee80211_wx_get_name: .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:499:3: warning: String copy function overflows destination buffer strcat(wrqu->name," link.."); .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:497:3: warning: String copy function overflows destination buffer strcat(wrqu->name," linked"); The buffer wrqu->name is only IFNAMSIZ bytes big (currently 16), so if we have a "802.11b/g/n linked" device we overrun the buffer by 3 bytes. -> Use strlcopy / strlcat to populate the name. This is done in a similar fashion in staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c While at it cleaned some whitespace issues. Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed