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) |
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 a79c87210..fc7582827 100644 --- a/ssh-pkcs11-client.c +++ b/ssh-pkcs11-client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-pkcs11-client.c,v 1.7 2017/05/30 08:52:19 markus Exp $ */ | 1 | /* $OpenBSD: ssh-pkcs11-client.c,v 1.8 2018/02/05 05:37:46 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2010 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2010 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -99,7 +99,8 @@ pkcs11_init(int interactive) | |||
99 | void | 99 | void |
100 | pkcs11_terminate(void) | 100 | pkcs11_terminate(void) |
101 | { | 101 | { |
102 | close(fd); | 102 | if (fd >= 0) |
103 | close(fd); | ||
103 | } | 104 | } |
104 | 105 | ||
105 | static int | 106 | static int |