From: Matthijs Mekking Date: Fri, 11 Jul 2014 15:38:07 +0000 (+0000) Subject: malloc calloc patch X-Git-Tag: release-1.5.0rc1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2669be8beb4df20a05e4716587cdef253f9ea816;p=thirdparty%2Funbound.git malloc calloc patch git-svn-id: file:///svn/unbound/trunk@3173 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/compat/fake-rfc2553.c b/compat/fake-rfc2553.c index 91ddf8a80..0f0f34f1f 100644 --- a/compat/fake-rfc2553.c +++ b/compat/fake-rfc2553.c @@ -120,12 +120,10 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints) { struct addrinfo *ai; - ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in)); + ai = calloc(1, sizeof(*ai) + sizeof(struct sockaddr_in)); if (ai == NULL) return (NULL); - memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in)); - ai->ai_addr = (struct sockaddr *)(ai + 1); /* XXX -- ssh doesn't use sa_len */ ai->ai_addrlen = sizeof(struct sockaddr_in); diff --git a/doc/Changelog b/doc/Changelog index 0b5db0765..f68baaf16 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +11 July 2014: Matthijs + - fake-rfc2553 patch (thanks Benjamin Baier). + 11 July 2014: Wouter - arc4random in compat/ and getentropy, explicit_bzero, chacha for dependencies, from OpenBSD. arc4_lock and sha512 in compat.