From 69160e55db06b0bf5987e3e39c9b584f19cb902f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 23 Jun 2015 10:02:17 +0200 Subject: [PATCH] lib: Fix CID 1272913 Calling risky function Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/addns/dnsrecord.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/addns/dnsrecord.c b/lib/addns/dnsrecord.c index 724d0dfd8fa..0d149373997 100644 --- a/lib/addns/dnsrecord.c +++ b/lib/addns/dnsrecord.c @@ -22,6 +22,7 @@ */ #include "dns.h" +#include "lib/util/genrand.h" DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name, uint16_t q_type, uint16_t q_class, @@ -39,7 +40,7 @@ DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name, return ERROR_DNS_NO_MEMORY; } - req->id = random(); + generate_random_buffer((uint8_t *)&req->id, sizeof(req->id)); req->num_questions = 1; q = req->questions[0]; -- 2.11.4.GIT