• P
    bt: rewrite csrhci_write to avoid out-of-bounds writes · 141af038
    Paolo Bonzini 提交于
    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: NPaolo Bonzini <pbonzini@redhat.com>
    141af038
hci-csr.c 12.7 KB