Skip to content
Snippets Groups Projects
Commit f54e8e1e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Greg Kroah-Hartman
Browse files

media: s5p-jpeg: prevent buffer overflows


commit 14a22762 upstream.

The current logic allows word to be less than 2. If this happens,
there will be buffer overflows, as reported by smatch. Add extra
checks to prevent it.

While here, remove an unused word = 0 assignment.

Fixes: 6c96dbbc ("[media] s5p-jpeg: add support for 5433")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a977b55
No related branches found
No related tags found
2 merge requests!185🤖 Sync Bot: Update v5.10-ktn to Latest Stable Kernel (v5.10.234),!172🤖 Sync Bot: Update v5.10-ktn to Latest Stable Kernel (v5.10.230)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment