diff options
author | Arend van Spriel <arend@broadcom.com> | 2012-09-13 15:12:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-24 14:59:09 -0400 |
commit | 4f6e1cafe25df11f4c8afe5d6a3ee051aa6d5de3 (patch) | |
tree | 1d0a6212f4719d9fa3566935ad6f3cab58222915 /drivers/net/wireless/brcm80211 | |
parent | 9cd23a7191f1abc32252ba92494a910d5cc5fd02 (diff) |
brcmfmac: add parameter check in brcmf_c_mkiovar()
This patch assures data is only appended in output buffer when
data is not NULL and datalen is not zero.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index f6b862d7798..c45270a2a1d 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | |||
@@ -80,8 +80,10 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen) | |||
80 | strncpy(buf, name, buflen); | 80 | strncpy(buf, name, buflen); |
81 | 81 | ||
82 | /* append data onto the end of the name string */ | 82 | /* append data onto the end of the name string */ |
83 | memcpy(&buf[len], data, datalen); | 83 | if (data && datalen) { |
84 | len += datalen; | 84 | memcpy(&buf[len], data, datalen); |
85 | len += datalen; | ||
86 | } | ||
85 | 87 | ||
86 | return len; | 88 | return len; |
87 | } | 89 | } |