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