OSDN Git Service

ath9k_htc: fix NULL-deref at probe
authorJohan Hovold <johan@kernel.org>
Mon, 13 Mar 2017 12:44:20 +0000 (13:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 12:30:09 +0000 (14:30 +0200)
commit670a7c5db22e9a82822123166c0c12e2c560b9f6
tree8773f321ded300b8d4a76eba6eba04e1d01c427c
parent8431037ba10b5410d28cc3c86dc7fc32226270b9
ath9k_htc: fix NULL-deref at probe

commit ebeb36670ecac36c179b5fb5d5c88ff03ba191ec upstream.

Make sure to check the number of endpoints to avoid dereferencing a
NULL-pointer or accessing memory beyond the endpoint array should a
malicious device lack the expected endpoints.

Fixes: 36bcce430657 ("ath9k_htc: Handle storage devices")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath9k/hif_usb.c