diff options
author | tb@openbsd.org <tb@openbsd.org> | 2018-02-05 05:37:46 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-02-07 07:50:46 +1100 |
commit | 3484380110d437c50e17f87d18544286328c75cb (patch) | |
tree | 15496664aa5eea31f3791f3791147243b726e304 /ssh-pkcs11-client.c | |
parent | 5069320be93c8b2a6584b9f944c86f60c2b04e48 (diff) | |
download | openssh-git-3484380110d437c50e17f87d18544286328c75cb.tar.gz |
upstream commit
Add a couple of non-negativity checks to avoid close(-1).
ok djm
OpenBSD-Commit-ID: 4701ce0b37161c891c838d0931305f1d37a50880
Diffstat (limited to 'ssh-pkcs11-client.c')
-rw-r--r-- | ssh-pkcs11-client.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ssh-pkcs11-client.c b/ssh-pkcs11-client.c index a79c8721..fc758282 100644 --- a/ssh-pkcs11-client.c +++ b/ssh-pkcs11-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-pkcs11-client.c,v 1.7 2017/05/30 08:52:19 markus Exp $ */ +/* $OpenBSD: ssh-pkcs11-client.c,v 1.8 2018/02/05 05:37:46 tb Exp $ */ /* * Copyright (c) 2010 Markus Friedl. All rights reserved. * @@ -99,7 +99,8 @@ pkcs11_init(int interactive) void pkcs11_terminate(void) { - close(fd); + if (fd >= 0) + close(fd); } static int |