diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2019-06-27 18:03:37 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-06-28 11:30:18 +1000 |
commit | 5cdbaa78fcb718c39af4522d98016ad89d065427 (patch) | |
tree | 8bd947edc2f0139849a76efdcf97f96465683cc9 /sshkey-xmss.c | |
parent | b2e3e57be4a933d9464bccbe592573725765486f (diff) |
upstream: Some asprintf() calls were checked < 0, rather than the
precise == -1. ok millert nicm tb, etc
OpenBSD-Commit-ID: caecf8f57938685c04f125515b9f2806ad408d53
Diffstat (limited to 'sshkey-xmss.c')
-rw-r--r-- | sshkey-xmss.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sshkey-xmss.c b/sshkey-xmss.c index aaae70289..ef39831c6 100644 --- a/sshkey-xmss.c +++ b/sshkey-xmss.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey-xmss.c,v 1.3 2018/07/09 21:59:10 markus Exp $ */ | 1 | /* $OpenBSD: sshkey-xmss.c,v 1.4 2019/06/27 18:03:37 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2017 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -467,9 +467,9 @@ sshkey_xmss_get_state(const struct sshkey *k, sshkey_printfn *pr) | |||
467 | } | 467 | } |
468 | if ((filename = k->xmss_filename) == NULL) | 468 | if ((filename = k->xmss_filename) == NULL) |
469 | goto done; | 469 | goto done; |
470 | if (asprintf(&lockfile, "%s.lock", filename) < 0 || | 470 | if (asprintf(&lockfile, "%s.lock", filename) == -1 || |
471 | asprintf(&statefile, "%s.state", filename) < 0 || | 471 | asprintf(&statefile, "%s.state", filename) == -1 || |
472 | asprintf(&ostatefile, "%s.ostate", filename) < 0) { | 472 | asprintf(&ostatefile, "%s.ostate", filename) == -1) { |
473 | ret = SSH_ERR_ALLOC_FAIL; | 473 | ret = SSH_ERR_ALLOC_FAIL; |
474 | goto done; | 474 | goto done; |
475 | } | 475 | } |
@@ -594,9 +594,9 @@ sshkey_xmss_update_state(const struct sshkey *k, sshkey_printfn *pr) | |||
594 | state->idx = idx; | 594 | state->idx = idx; |
595 | if ((filename = k->xmss_filename) == NULL) | 595 | if ((filename = k->xmss_filename) == NULL) |
596 | goto done; | 596 | goto done; |
597 | if (asprintf(&statefile, "%s.state", filename) < 0 || | 597 | if (asprintf(&statefile, "%s.state", filename) == -1 || |
598 | asprintf(&ostatefile, "%s.ostate", filename) < 0 || | 598 | asprintf(&ostatefile, "%s.ostate", filename) == -1 || |
599 | asprintf(&nstatefile, "%s.nstate", filename) < 0) { | 599 | asprintf(&nstatefile, "%s.nstate", filename) == -1) { |
600 | ret = SSH_ERR_ALLOC_FAIL; | 600 | ret = SSH_ERR_ALLOC_FAIL; |
601 | goto done; | 601 | goto done; |
602 | } | 602 | } |