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>
This commit is contained in:
Arend van Spriel 2012-09-13 21:12:05 +02:00 committed by John W. Linville
parent 9cd23a7191
commit 4f6e1cafe2
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}