1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

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>
This commit is contained in:
Stefan Metzmacher 2013-10-16 14:17:49 +02:00 committed by Karolin Seeger
parent 94b2641a53
commit 6e293891ca

View File

@ -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;