Add break to error out on weird characters in gethostbyname().
authorflorian <florian@openbsd.org>
Tue, 14 Nov 2023 08:27:33 +0000 (08:27 +0000)
committerflorian <florian@openbsd.org>
Tue, 14 Nov 2023 08:27:33 +0000 (08:27 +0000)
Missed in previous some time ago; while here remove confusing else.

Input & OK eric

lib/libc/asr/gethostnamadr_async.c

index e40811b..bdc00cb 100644 (file)
@@ -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 <eric@openbsd.org>
  *
@@ -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);