OpenSSH
[Top] [All Lists]

Re: "Out of memory" error looking up SSHFP records

To: Darren Tucker <dtucker@zip.com.au>
Subject: Re: "Out of memory" error looking up SSHFP records
From: Simon Vallet <svallet@genoscope.cns.fr>
Date: Fri, 9 Feb 2007 12:10:27 +0100
Cc: openssh-unix-dev@mindrot.org
Delivered-to: sp-com-lists@consult.net
Delivered-to: openssh-unix-dev-list1@securepoint.com
Delivered-to: openssh-unix-dev-tmda@mindrot.org
Delivered-to: openssh-unix-dev@mindrot.org
In-reply-to: <20070209110349.15bb9492@tx174.tx.local>
List-archive: <http://lists.mindrot.org/pipermail/openssh-unix-dev>
List-help: <mailto:openssh-unix-dev-request@mindrot.org?subject=help>
List-id: Development of portable OpenSSH <openssh-unix-dev.mindrot.org>
List-post: <mailto:openssh-unix-dev@mindrot.org>
List-subscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=subscribe>
List-unsubscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=unsubscribe>
Organization: Génoscope / CNRG
References: <20070208112131.1a858b91.svallet@genoscope.cns.fr> <45CBDF22.4000609@zip.com.au> <20070209110349.15bb9492@tx174.tx.local>
Sender: openssh-unix-dev-bounces+openssh-unix-dev-list1=securepoint.com@mindrot.org
On Fri, 9 Feb 2007 11:03:49 +0100
Simon Vallet <svallet@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
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

<Prev in Thread] Current Thread [Next in Thread>