bt: fix use of uninitialized variable seqlen
commit374ec0669a1aa3affac7850a16c6cad18221c439
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 19 Oct 2015 14:08:40 +0000 (19 16:08 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 6 Nov 2015 12:42:38 +0000 (6 15:42 +0300)
treec561a1c89a00cb8c4b43ba8af9a1fc65dcba32f8
parent1a13b27273cdc4f6fd18bc1e83950d47c6b5928b
bt: fix use of uninitialized variable seqlen

sdp_svc_match, sdp_attr_match and sdp_svc_attr_match read the last
argument.  The only sensible way to change the code is to make that last
argument "len" instead of "seqlen" which is the length of a subsequence
in the previous "if" branch.

To make the structure of the code clearer, use "else" instead of
"else if".

Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/bt/sdp.c