summaryrefslogtreecommitdiff
path: root/sshkey-xmss.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2019-06-27 18:03:37 +0000
committerDamien Miller <djm@mindrot.org>2019-06-28 11:30:18 +1000
commit5cdbaa78fcb718c39af4522d98016ad89d065427 (patch)
tree8bd947edc2f0139849a76efdcf97f96465683cc9 /sshkey-xmss.c
parentb2e3e57be4a933d9464bccbe592573725765486f (diff)
downloadopenssh-git-5cdbaa78fcb718c39af4522d98016ad89d065427.tar.gz
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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sshkey-xmss.c b/sshkey-xmss.c
index aaae7028..ef39831c 100644
--- a/sshkey-xmss.c
+++ b/sshkey-xmss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey-xmss.c,v 1.3 2018/07/09 21:59:10 markus Exp $ */
+/* $OpenBSD: sshkey-xmss.c,v 1.4 2019/06/27 18:03:37 deraadt Exp $ */
/*
* Copyright (c) 2017 Markus Friedl. All rights reserved.
*
@@ -467,9 +467,9 @@ sshkey_xmss_get_state(const struct sshkey *k, sshkey_printfn *pr)
}
if ((filename = k->xmss_filename) == NULL)
goto done;
- if (asprintf(&lockfile, "%s.lock", filename) < 0 ||
- asprintf(&statefile, "%s.state", filename) < 0 ||
- asprintf(&ostatefile, "%s.ostate", filename) < 0) {
+ if (asprintf(&lockfile, "%s.lock", filename) == -1 ||
+ asprintf(&statefile, "%s.state", filename) == -1 ||
+ asprintf(&ostatefile, "%s.ostate", filename) == -1) {
ret = SSH_ERR_ALLOC_FAIL;
goto done;
}
@@ -594,9 +594,9 @@ sshkey_xmss_update_state(const struct sshkey *k, sshkey_printfn *pr)
state->idx = idx;
if ((filename = k->xmss_filename) == NULL)
goto done;
- if (asprintf(&statefile, "%s.state", filename) < 0 ||
- asprintf(&ostatefile, "%s.ostate", filename) < 0 ||
- asprintf(&nstatefile, "%s.nstate", filename) < 0) {
+ if (asprintf(&statefile, "%s.state", filename) == -1 ||
+ asprintf(&ostatefile, "%s.ostate", filename) == -1 ||
+ asprintf(&nstatefile, "%s.nstate", filename) == -1) {
ret = SSH_ERR_ALLOC_FAIL;
goto done;
}