From c18b84ad6e405795233cad47a7d7fd9da736acb1 Mon Sep 17 00:00:00 2001
From: Jan Vcelak <jan.vcelak@nic.cz>
Date: Thu, 2 Oct 2014 09:39:00 +0200
Subject: [PATCH] tests: disable knot_dname_to_str_alloc() with incomplete
 dname

Buffer boundaries are checked in knot_dname_wire_check(). The tested
function expects a valid dname. As a result, a memory outside the static
buffer is accessed.
---
 tests/dname.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/dname.c b/tests/dname.c
index 1b3d6df9b5..57c619b489 100644
--- a/tests/dname.c
+++ b/tests/dname.c
@@ -104,7 +104,7 @@ static void test_str(const char *in_str, const char *in_bin, size_t bin_len) {
 
 int main(int argc, char *argv[])
 {
-	plan(285);
+	plan_lazy();
 
 	knot_dname_t *d = NULL, *d2 = NULL;
 	const char *w = NULL, *t = NULL;
@@ -303,10 +303,12 @@ int main(int argc, char *argv[])
 	}
 
 	/* incomplete dname */
+	/* ASAN: global-buffer-overflow
 	w = "\x08" "dddd";
 	s = knot_dname_to_str_alloc((const uint8_t *)w);
 	ok(s != NULL, "dname_to_str: incomplete dname");
 	free(s);
+	*/
 
 	/* non-fqdn */
 	w = "\x02" "ab";
-- 
GitLab