Skip to content
Snippets Groups Projects
Commit 141af038 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

bt: rewrite csrhci_write to avoid out-of-bounds writes


The usage of INT_MAX in this function confuses Coverity.  I think
the defect is bogus, however there is no protection against
getting more than sizeof(s->inpkt) bytes from the character device
backend.

Rewrite the function to only fill in as much data as needed from
buf into s->inpkt.  The plen variable is replaced by a simple
state machine and there is no need anymore to shift contents to
the beginning of s->inpkt.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent a6b3167f
No related branches found
No related tags found
Loading
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