Re: Re: PROPOSAL: make PostgreSQL sanitizers-friendly (and prevent information disclosure) - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Re: PROPOSAL: make PostgreSQL sanitizers-friendly (and prevent information disclosure)
Date
Msg-id b127ee5a-301c-40bd-6aba-10f507e4cf6f@2ndquadrant.com
Whole thread Raw
In response to Re: Re: PROPOSAL: make PostgreSQL sanitizers-friendly (and prevent information disclosure)  (Aleksander Alekseev <a.alekseev@postgrespro.ru>)
List pgsql-hackers
On 3/22/16 9:27 AM, Aleksander Alekseev wrote:
> diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
> index 28f9fb5..45aa802 100644
> --- a/src/backend/libpq/hba.c
> +++ b/src/backend/libpq/hba.c
> @@ -1008,14 +1008,9 @@ parse_hba_line(List *line, int line_num, char *raw_line)
>                  *cidr_slash = '\0';
>  
>              /* Get the IP address either way */
> +            memset(&hints, 0, sizeof(hints));
>              hints.ai_flags = AI_NUMERICHOST;
>              hints.ai_family = AF_UNSPEC;
> -            hints.ai_socktype = 0;
> -            hints.ai_protocol = 0;
> -            hints.ai_addrlen = 0;
> -            hints.ai_canonname = NULL;
> -            hints.ai_addr = NULL;
> -            hints.ai_next = NULL;
>  
>              ret = pg_getaddrinfo_all(str, NULL, &hints, &gai_result);
>              if (ret == 0 && gai_result)

In addition to what Heikki wrote, I think the above is not necessary.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Christian Convey
Date:
Subject: Re: WIP: About CMake v2
Next
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Fix deletion of speculatively inserted TOAST on conflict