s3-lib: Fix %G substitution for domain users in smbd
[gd/samba-autobuild/.git] / source3 / lib / util_tsock.c
index 35a97f5e692c4e59f860b12cdc15a0df6348370b..03380ef244bb9dae9883769708cd3330424fb4bc 100644 (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;