From: florian Date: Tue, 14 Nov 2023 08:27:33 +0000 (+0000) Subject: Add break to error out on weird characters in gethostbyname(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b8fce260d60f6211b2f80fb68257eded12d7294d;p=openbsd Add break to error out on weird characters in gethostbyname(). Missed in previous some time ago; while here remove confusing else. Input & OK eric --- 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);