diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-04-10 20:35:12 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-05-01 17:38:23 +0200 |
commit | 66a2cd36c674bf4f235aa28f9c1786d9937ebe2a (patch) | |
tree | e6118c3fee5767ca2e71132b2f361d93a2f61291 | |
parent | 997eb9eb4323ec117625ae0ad90f32049f33d83b (diff) | |
download | samba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.tar.gz samba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.tar.bz2 samba-66a2cd36c674bf4f235aa28f9c1786d9937ebe2a.zip |
tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0
metze
-rw-r--r-- | lib/tsocket/tsocket.c | 5 |
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)) { |