diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-10-16 14:17:49 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2013-12-05 11:11:52 +0100 |
commit | 9242121dcae43a736a9de5cf73c48a6dc95516f8 (patch) | |
tree | 8e62936c790418bf53439cd4f8dc79134194ad0a | |
parent | 27a751632eb3bfc3f5610314b8254d16d027c0b0 (diff) | |
download | samba-9242121dcae43a736a9de5cf73c48a6dc95516f8.tar.gz |
CVE-2013-4408:s3:util_tsock: add some overflow detection to tstream_read_packet_done()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/lib/util_tsock.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/util_tsock.c b/source3/lib/util_tsock.c index 35a97f5e692..03380ef244b 100644 --- a/source3/lib/util_tsock.c +++ b/source3/lib/util_tsock.c @@ -110,6 +110,11 @@ static void tstream_read_packet_done(struct tevent_req *subreq) return; } + if (total + more < total) { + tevent_req_error(req, EMSGSIZE); + return; + } + tmp = talloc_realloc(state, state->buf, uint8_t, total+more); if (tevent_req_nomem(tmp, req)) { return; |