"Out of memory" error looking up SSHFP records

Simon Vallet svallet at genoscope.cns.fr
Fri Feb 9 22:10:27 EST 2007


On Fri, 9 Feb 2007 11:03:49 +0100
Simon Vallet <svallet at genoscope.cns.fr> wrote:

> So it seems an alloc is failing somewhere... I'll try to confirm this
> and get back to you.

Yup -- the following returns a null pointer due to rrset->rri_nsigs
being 0 :

rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));

This is what POSIX has to say on the subject:

"If the size of the space requested is 0, the behavior is
implementation-defined: the value returned shall be either a null
pointer or a unique pointer."

I don't know how other OSes implement it, but checking for the presence
of SIG records somewhere might be good idea.

Simon


More information about the openssh-unix-dev mailing list