summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-04-10 20:35:12 +0200
committerStefan Metzmacher <metze@samba.org>2009-05-01 17:38:23 +0200
commit66a2cd36c674bf4f235aa28f9c1786d9937ebe2a (patch)
treee6118c3fee5767ca2e71132b2f361d93a2f61291 /lib
parent997eb9eb4323ec117625ae0ad90f32049f33d83b (diff)
downloadsamba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.tar.gz
samba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.tar.bz2
samba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.zip
tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0
metze
Diffstat (limited to 'lib')
-rw-r--r--lib/tsocket/tsocket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket.c b/lib/tsocket/tsocket.c
index 8e97997d85..11ae6ce9ed 100644
--- a/lib/tsocket/tsocket.c
+++ b/lib/tsocket/tsocket.c
@@ -219,6 +219,11 @@ struct tevent_req *tdgram_sendto_send(TALLOC_CTX *mem_ctx,
state->ops = dgram->ops;
state->ret = -1;
+ if (len == 0) {
+ tevent_req_error(req, EINVAL);
+ goto post;
+ }
+
subreq = state->ops->sendto_send(state, ev, dgram,
buf, len, dst);
if (tevent_req_nomem(subreq, req)) {