summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 8e97997d858..11ae6ce9ed1 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)) {