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 /hostfile.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 'hostfile.c')
-rw-r--r-- | hostfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hostfile.c b/hostfile.c index e1f826bdd..eaa237c81 100644 --- a/hostfile.c +++ b/hostfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hostfile.c,v 1.73 2018/07/16 03:09:13 djm Exp $ */ | 1 | /* $OpenBSD: hostfile.c,v 1.74 2019/06/27 18:03:37 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -545,8 +545,8 @@ hostfile_replace_entries(const char *filename, const char *host, const char *ip, | |||
545 | /* | 545 | /* |
546 | * Prepare temporary file for in-place deletion. | 546 | * Prepare temporary file for in-place deletion. |
547 | */ | 547 | */ |
548 | if ((r = asprintf(&temp, "%s.XXXXXXXXXXX", filename)) < 0 || | 548 | if ((r = asprintf(&temp, "%s.XXXXXXXXXXX", filename)) = -1 || |
549 | (r = asprintf(&back, "%s.old", filename)) < 0) { | 549 | (r = asprintf(&back, "%s.old", filename)) == -1) { |
550 | r = SSH_ERR_ALLOC_FAIL; | 550 | r = SSH_ERR_ALLOC_FAIL; |
551 | goto fail; | 551 | goto fail; |
552 | } | 552 | } |