summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-06-07 16:16:01 +0000
committerderaadt <deraadt@openbsd.org>2020-06-07 16:16:01 +0000
commit30d3f3d9a6bd805f226514fbf3d455eb7d2ba7e6 (patch)
treea972f53a1a117a6719f35dd6e0d4401860a4fe7f /lib/libc
parentProbe the PCI bus. (diff)
downloadwireguard-openbsd-30d3f3d9a6bd805f226514fbf3d455eb7d2ba7e6.tar.xz
wireguard-openbsd-30d3f3d9a6bd805f226514fbf3d455eb7d2ba7e6.zip
In the libc resolver function asr_run(), clear the result buffer everytime,
because there are callers who were inspecting unrelated fields. discussion with eric, otto, solution from semarie this is errata 6.6/031_asr and 6.7/009_asr
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/asr/asr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index cd056c85719..131da4b2190 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.62 2019/10/24 05:57:41 otto Exp $ */
+/* $OpenBSD: asr.c,v 1.63 2020/06/07 16:16:01 deraadt Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -171,6 +171,8 @@ asr_run(struct asr_query *as, struct asr_result *ar)
{
int r, saved_errno = errno;
+ memset(ar, 0, sizeof(*ar));
+
DPRINT("asr: asr_run(%p, %p) %s ctx=[%p]\n", as, ar,
_asr_querystr(as->as_type), as->as_ctx);
r = as->as_run(as, ar);