[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-3.1 1/4] slirp: Don't pass possibly -1 fd to
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCH for-3.1 1/4] slirp: Don't pass possibly -1 fd to send() |
Date: |
Wed, 7 Nov 2018 00:05:44 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Peter Maydell, le mar. 06 nov. 2018 15:13:20 +0000, a ecrit:
> Coverity complains (CID 1005726) that we might pass -1 as the fd
> argument to send() in slirp_send(), because we previously checked for
> "so->s == -1 && so->extra". The case of "so->s == -1 but so->extra
> NULL" should not in theory happen, but it is hard to guarantee
> because various places in the code do so->s = qemu_socket(...) and so
> will end up with so->s == -1 on failure, and not all the paths which
> call that always throw away the socket in that case (eg
> tcp_fconnect()). So just check specifically for the condition and
> fail slirp_send().
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> This is to some extent just placating Coverity.
Applied, thanks!