mirror of
https://github.com/open-simh/simh.git
synced 2026-02-26 17:03:56 +00:00
slirp: Make sure to completely initialize the iov on a 0 buffer size return
This commit is contained in:
@@ -93,12 +93,14 @@ size_t sopreprbuf(struct socket *so, struct iovec *iov, int *np)
|
||||
DEBUG_CALL("sopreprbuf");
|
||||
DEBUG_ARG("so = %lx", (long )so);
|
||||
|
||||
if (len <= 0)
|
||||
return 0;
|
||||
|
||||
iov[0].iov_base = sb->sb_wptr;
|
||||
iov[1].iov_base = NULL;
|
||||
iov[1].iov_len = 0;
|
||||
if (np)
|
||||
*np = 1;
|
||||
if (len <= 0)
|
||||
return 0;
|
||||
|
||||
if (sb->sb_wptr < sb->sb_rptr) {
|
||||
iov[0].iov_len = sb->sb_rptr - sb->sb_wptr;
|
||||
/* Should never succeed, but... */
|
||||
|
||||
Reference in New Issue
Block a user