summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-10-30 16:28:23 +0200
committerStefan Metzmacher <metze@samba.org>2011-03-03 22:57:26 +0100
commitec028b555bbca84e1f949c6632099f8407c0d695 (patch)
treea5f02a38058fd86a038ae135524af2648a0b9ee4 /lib
parent7bdc3db9ea5380eeee8d975b3579dcf673a0eafa (diff)
downloadsamba-ec028b555bbca84e1f949c6632099f8407c0d695.tar.gz
samba-ec028b555bbca84e1f949c6632099f8407c0d695.tar.xz
samba-ec028b555bbca84e1f949c6632099f8407c0d695.zip
socket_wrapper: readv() should only work on connected sockets
metze
Diffstat (limited to 'lib')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index d1508adbca..26988f0b1f 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -2244,6 +2244,11 @@ int swrap_readv(int s, const struct iovec *vector, size_t count)
return real_readv(s, vector, count);
}
+ if (!si->connected) {
+ errno = ENOTCONN;
+ return -1;
+ }
+
if (si->type == SOCK_STREAM && count > 0) {
/* cut down to 1500 byte packets for stream sockets,
* which makes it easier to format PCAP capture files