Commit 2c84067
wil6210: check len before memcpy() calls
memcpy() in wmi_set_ie() and wmi_update_ft_ies() is called with
src == NULL and len == 0. This is an undefined behavior. Fix it
by checking "ie_len > 0" before the memcpy() calls.
As suggested by GCC documentation:
"The pointers passed to memmove (and similar functions in <string.h>)
must be non-null even when nbytes==0, so GCC can use that information
to remove the check after the memmove call." [1]
[1] https://gcc.gnu.org/gcc-4.9/porting_to.html
Cc: Maya Erez <merez@codeaurora.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>1 parent 315cee4 commit 2c84067
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
2508 | | - | |
| 2508 | + | |
| 2509 | + | |
2509 | 2510 | | |
2510 | 2511 | | |
2511 | 2512 | | |
| |||
2541 | 2542 | | |
2542 | 2543 | | |
2543 | 2544 | | |
2544 | | - | |
| 2545 | + | |
| 2546 | + | |
2545 | 2547 | | |
2546 | 2548 | | |
2547 | 2549 | | |
| |||
0 commit comments