diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2014-10-28 19:34:05 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2014-10-28 19:34:05 +0000 |
commit | 03e049de8d7b7e3e6ad3a0cb9e52dc1e95ae543c (patch) | |
tree | 073863c1f4e3505328208157f2dc846331a4a3ca | |
parent | 0fe31a1edfeaf54d48c6730d975b698a82e51bf5 (diff) | |
download | illumos-joyent-03e049de8d7b7e3e6ad3a0cb9e52dc1e95ae543c.tar.gz |
OS-3482 lxbrand ltp recvfrom should fail when from_len == -1
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/common/socket.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/socket.c b/usr/src/lib/brand/lx/lx_brand/common/socket.c index c9209cf414..5e2a142bf7 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/socket.c +++ b/usr/src/lib/brand/lx/lx_brand/common/socket.c @@ -1209,6 +1209,16 @@ lx_recvfrom(int sockfd, void *buf, size_t len, int flags, void *from, lx_debug("\trecvfrom(%d, 0x%p, 0x%d, 0x%x, 0x%p, 0x%p)", sockfd, buf, len, flags, from, from_lenp); + /* LTP expects EINVAL when from_len == -1 */ + if (from_lenp != NULL) { + int flen; + + if (uucopy(from_lenp, &flen, sizeof (int)) != 0) + return (-errno); + if (flen == -1) + return (-EINVAL); + } + flags = convert_sockflags(flags, "recvfrom"); /* |