[media] cx231xx-cards: fix NULL-deref at probe
authorJohan Hovold <johan@kernel.org>
Mon, 13 Mar 2017 12:53:56 +0000 (09:53 -0300)
committerSasha Levin <alexander.levin@verizon.com>
Wed, 17 May 2017 19:08:22 +0000 (15:08 -0400)
commit5a4e9221b31bc62710b8eb3d46326f3be7eaaf5f
tree15c7ec6b8fe5355d3026b36b901bafffca6b7f6f
parenta44bcf6b4c54f8aff0680204629f613f263aef6a
[media] cx231xx-cards: fix NULL-deref at probe

[ Upstream commit 0cd273bb5e4d1828efaaa8dfd11b7928131ed149 ]

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: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver")
Cc: stable <stable@vger.kernel.org> # 2.6.30
Cc: Sri Deevi <Srinivasa.Deevi@conexant.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/media/usb/cx231xx/cx231xx-cards.c