From b8fce260d60f6211b2f80fb68257eded12d7294d Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 14 Nov 2023 08:27:33 +0000 Subject: [PATCH] Add break to error out on weird characters in gethostbyname(). Missed in previous some time ago; while here remove confusing else. Input & OK eric --- lib/libc/asr/gethostnamadr_async.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c index e40811b69ba..bdc00cbddfa 100644 --- a/lib/libc/asr/gethostnamadr_async.c +++ b/lib/libc/asr/gethostnamadr_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gethostnamadr_async.c,v 1.46 2022/11/17 17:39:41 florian Exp $ */ +/* $OpenBSD: gethostnamadr_async.c,v 1.47 2023/11/14 08:27:33 florian Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -202,11 +202,12 @@ gethostnamadr_async_run(struct asr_query *as, struct asr_result *ar) } async_set_state(as, ASR_STATE_HALT); break; - } else { - if (!hnok_lenient(as->as.hostnamadr.name)) { - ar->ar_gai_errno = EAI_FAIL; - async_set_state(as, ASR_STATE_HALT); - } + } + + if (!hnok_lenient(as->as.hostnamadr.name)) { + ar->ar_gai_errno = EAI_FAIL; + async_set_state(as, ASR_STATE_HALT); + break; } } async_set_state(as, ASR_STATE_NEXT_DB); -- 2.20.1