lib: Fix CID 1273234 Untrusted value as argument
authorVolker Lendecke <vl@samba.org>
Tue, 23 Jun 2015 08:12:15 +0000 (10:12 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 23 Jun 2015 20:12:08 +0000 (22:12 +0200)
buf->size has been sanitized in the checks done in talloc_array(). This makes
the "trust" flow more explicit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/addns/dnssock.c

index df17523439731a029b96ee995e7443668525ab29..a45e3255a54e0ba9b9e09e28bcc50b944d8db97e 100644 (file)
@@ -331,7 +331,7 @@ static DNS_ERROR dns_receive_tcp(TALLOC_CTX *mem_ctx,
                return ERROR_DNS_NO_MEMORY;
        }
 
-       err = read_all(conn->s, buf->data, buf->size);
+       err = read_all(conn->s, buf->data, talloc_get_size(buf->data));
        if (!ERR_DNS_IS_OK(err)) {
                TALLOC_FREE(buf);
                return err;