Commit 4f6e1caf authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

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: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9cd23a71
...@@ -80,8 +80,10 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen) ...@@ -80,8 +80,10 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen)
strncpy(buf, name, buflen); strncpy(buf, name, buflen);
/* append data onto the end of the name string */ /* append data onto the end of the name string */
memcpy(&buf[len], data, datalen); if (data && datalen) {
len += datalen; memcpy(&buf[len], data, datalen);
len += datalen;
}
return len; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment