summaryrefslogtreecommitdiff
path: root/misc.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 /misc.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 'misc.c')
-rw-r--r--misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 009e02bc..4011ee5f 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.137 2019/01/23 21:50:56 dtucker Exp $ */
+/* $OpenBSD: misc.c,v 1.138 2019/06/27 18:03:37 deraadt Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -550,7 +550,7 @@ put_host_port(const char *host, u_short port)
if (port == 0 || port == SSH_DEFAULT_PORT)
return(xstrdup(host));
- if (asprintf(&hoststr, "[%s]:%d", host, (int)port) < 0)
+ if (asprintf(&hoststr, "[%s]:%d", host, (int)port) == -1)
fatal("put_host_port: asprintf: %s", strerror(errno));
debug3("put_host_port: %s", hoststr);
return hoststr;