Skip to content

Commit

Permalink
brcmfmac: add parameter check in brcmf_c_mkiovar()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Sep 24, 2012
1 parent 9cd23a7 commit 4f6e1ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen)
strncpy(buf, name, buflen);

/* append data onto the end of the name string */
memcpy(&buf[len], data, datalen);
len += datalen;
if (data && datalen) {
memcpy(&buf[len], data, datalen);
len += datalen;
}

return len;
}
Expand Down

0 comments on commit 4f6e1ca

Please sign in to comment.