Re: using explicit_bzero - Mailing list pgsql-hackers

From Tom Lane
Subject Re: using explicit_bzero
Date
Msg-id 27860.1561123531@sss.pgh.pa.us
Whole thread Raw
In response to using explicit_bzero  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: using explicit_bzero  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Re: using explicit_bzero  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> +#ifndef HAVE_EXPLICIT_BZERO
> +#define explicit_bzero(b, len) bzero(b, len)
> +#endif

This presumes that every platform has bzero, which is unsafe (POSIX
doesn't specify it) and is an assumption we kicked to the curb a dozen
years ago (067a5cdb3).  Please use memset() for the substitute instead.

Also, I'm a bit suspicious of using AC_CHECK_FUNCS for this; that
generally Doesn't Work for anything that's not a vanilla out-of-line
function.  Are we worried about people implementing this as a macro,
compiler built-in, etc?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: ldapbindpasswdfile
Next
From: Mahesh S
Date:
Subject: Google Season of Docs