sshd crashes

Darren Tucker dtucker at dtucker.net
Mon Feb 17 19:46:19 AEDT 2020


On Mon, 17 Feb 2020 at 17:17, shiva kumar <shivakumar2696 at gmail.com> wrote:
> sshd crashes at below location.
> After compilation, when I start sshd it crashes in “sshbuf-misc.c” file
> inside “sshbuf_b64tod” function at line size_t plen = strlen(b64);
>
> The call trace is as below,
> Sshd main function -> sshkey_load_public -> sshkey_try_load_public ->
> sshkey_read -> sshbuf_b64tod
>
> During compilation a warning is thrown. Is this the trigger point for the
> crash?
> "sshkey.c", : warning #2223-D: function "strndup" declared implicitly
>         if ((blobcopy = strndup(cp, space)) == NULL)

It's possible.  It'll be implicitly declared to return an int and if
that's a different size to your char * the return value will be
truncated.

What platform is this?  Does it have a native strndup (ie is
HAVE_STRNDUP defined in config.h)?  If so, which header file is
strndup defined in?

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list