diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-04-16 09:27:35 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-04-16 09:27:35 +0100 |
commit | 677746b39f068f4dc7658bcb13274124c2108125 (patch) | |
tree | 3ef9600e41d62004bcae93c7d737f9bd90aa9ecf | |
parent | afccfc0c4c6134a7bc9da6375996b3b91d291de4 (diff) | |
parent | 6fabae61a9393fd2bc703837e464b9c34ec5ef25 (diff) |
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
Slirp updates
Dr. David Alan Gilbert (1):
slirp: Gcc 9 -O3 fix
# gpg: Signature made Mon 15 Apr 2019 19:05:39 BST
# gpg: using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
# gpg: aka "Samuel Thibault <sthibault@debian.org>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
# gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
# gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6
# Subkey fingerprint: E61D BB15 D417 2BDE C97E 92D9 DB55 0E89 F0FA 54F3
* remotes/thibault/tags/samuel-thibault:
slirp: Gcc 9 -O3 fix
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | slirp/src/socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/slirp/src/socket.c b/slirp/src/socket.c index 4a3c935e25..bb752fdcae 100644 --- a/slirp/src/socket.c +++ b/slirp/src/socket.c @@ -171,6 +171,7 @@ int soread(struct socket *so) { int n, nn; + size_t buf_len; struct sbuf *sb = &so->so_snd; struct iovec iov[2]; @@ -181,7 +182,8 @@ soread(struct socket *so) * No need to check if there's enough room to read. * soread wouldn't have been called if there weren't */ - sopreprbuf(so, iov, &n); + buf_len = sopreprbuf(so, iov, &n); + assert(buf_len != 0); nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0); if (nn <= 0) { @@ -257,6 +259,7 @@ int soreadbuf(struct socket *so, const char *buf, int size) * No need to check if there's enough room to read. * soread wouldn't have been called if there weren't */ + assert(size > 0); if (sopreprbuf(so, iov, &n) < size) goto err; |