summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-06-07 16:16:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-06-07 16:16:02 +0000
commitb2748beaf128f0249797ad29f591ab83a088361a (patch)
tree8d62cb7ee812a63c1d5f5ba7afd6403f1a1514c0
parente06cb9c47d8c65b783118f5e3d313f2d08f5cedf (diff)
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
-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);