upstream: if passed a bad fd, log what it was

OpenBSD-Commit-ID: 582e2bd05854e49365195b58989b68ac67f09140
This commit is contained in:
djm@openbsd.org 2019-06-14 03:28:19 +00:00 committed by Damien Miller
parent 7349149da1
commit a5a5391498
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keysign.c,v 1.57 2019/06/06 05:13:13 otto Exp $ */
/* $OpenBSD: ssh-keysign.c,v 1.58 2019/06/14 03:28:19 djm Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
@ -251,7 +251,7 @@ main(int argc, char **argv)
if ((r = sshbuf_get_u32(b, (u_int *)&fd)) != 0)
fatal("%s: buffer error: %s", __progname, ssh_err(r));
if (fd < 0 || fd == STDIN_FILENO || fd == STDOUT_FILENO)
fatal("bad fd");
fatal("bad fd = %d", fd);
if ((host = get_local_name(fd)) == NULL)
fatal("cannot get local name for fd");