From 66a2cd36c674bf4f235aa28f9c1786d9937ebe2a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Apr 2009 20:35:12 +0200 Subject: [PATCH] tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0 metze --- lib/tsocket/tsocket.c | 5 +++++ 1 file changed, 5 insertions(+) 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)) {