From 325418a7a3c0e22cfbd6726693d780c1afd9d9c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Mon, 9 Dec 2019 14:47:40 +0100 Subject: [PATCH] tests: use blob_parse_untrusted variant MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In order to be able to use invalid input for testing as well. Signed-off-by: Petr Å tetiar --- tests/fuzz/test-fuzz.c | 2 +- tests/test-blob-parse.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fuzz/test-fuzz.c b/tests/fuzz/test-fuzz.c index 7153847..52f2bbc 100644 --- a/tests/fuzz/test-fuzz.c +++ b/tests/fuzz/test-fuzz.c @@ -64,7 +64,7 @@ static void fuzz_blob_parse(const uint8_t *data, size_t size) struct blob_attr *foo[__FOO_ATTR_MAX]; struct blob_attr *buf = (struct blob_attr *)data; - blob_parse(buf, foo, foo_policy, __FOO_ATTR_MAX); + blob_parse_untrusted(buf, size, foo, foo_policy, __FOO_ATTR_MAX); } int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) diff --git a/tests/test-blob-parse.c b/tests/test-blob-parse.c index 6b1fb56..6d65eb4 100644 --- a/tests/test-blob-parse.c +++ b/tests/test-blob-parse.c @@ -87,7 +87,7 @@ static int cert_load(const char *certfile, struct list_head *chain) bufpt = (struct blob_attr *)filebuf; do { - pret = blob_parse(bufpt, certtb, cert_policy, CERT_ATTR_MAX); + pret = blob_parse_untrusted(bufpt, len, certtb, cert_policy, CERT_ATTR_MAX); if (pret <= 0) /* no attributes found */ break; -- 2.25.1