mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
malloc calloc patch
git-svn-id: file:///svn/unbound/trunk@3173 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
12137fe970
commit
2669be8beb
2 changed files with 4 additions and 3 deletions
|
|
@ -120,12 +120,10 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
|
||||||
{
|
{
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai;
|
||||||
|
|
||||||
ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
|
ai = calloc(1, sizeof(*ai) + sizeof(struct sockaddr_in));
|
||||||
if (ai == NULL)
|
if (ai == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
|
|
||||||
|
|
||||||
ai->ai_addr = (struct sockaddr *)(ai + 1);
|
ai->ai_addr = (struct sockaddr *)(ai + 1);
|
||||||
/* XXX -- ssh doesn't use sa_len */
|
/* XXX -- ssh doesn't use sa_len */
|
||||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
11 July 2014: Matthijs
|
||||||
|
- fake-rfc2553 patch (thanks Benjamin Baier).
|
||||||
|
|
||||||
11 July 2014: Wouter
|
11 July 2014: Wouter
|
||||||
- arc4random in compat/ and getentropy, explicit_bzero, chacha for
|
- arc4random in compat/ and getentropy, explicit_bzero, chacha for
|
||||||
dependencies, from OpenBSD. arc4_lock and sha512 in compat.
|
dependencies, from OpenBSD. arc4_lock and sha512 in compat.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue