Subject: Re: [PATCH] knownhost_check(): Don't dereference ext if NULL is passed

Re: [PATCH] knownhost_check(): Don't dereference ext if NULL is passed

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Fri, 18 Nov 2011 12:13:59 +0000

On 15 November 2011 10:14, Peter Krempa <pkrempa_at_redhat.com> wrote:
> Documentation for libssh2_knownhost_checkp() and related functions
> states that the last argument is filled with data if non-NULL.
>
> "knownhost if set to non-NULL, it must be a pointer to a 'struct
> libssh2_knownhost' pointer that gets filled in to point to info about a
> known host that matches or partially matches."
>
> In this function ext is dereferenced even if set to NULL, causing
> segfault in applications not needing the extra data.

You're quite right, the code isn't treating ext as an optional
argument. Please create your patch using 'git format-patch' so we
have all the metadata (mainly your authorship).

Alex

--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-11-18