diff mbox series

[ovs-dev] ossfuzz: Fix expr target build failure

Message ID 20190530103823.6786-1-bshastry@sect.tu-berlin.de
State Accepted
Commit 54b4f001ce2d97dccc803ffad953824f9ac33455
Headers show
Series [ovs-dev] ossfuzz: Fix expr target build failure | expand

Commit Message

Bhargava Shastry May 30, 2019, 10:38 a.m. UTC
From: Bhargava Shastry <bshastry@sect.tu-berlin.de>

Google oss-fuzz reported a build failure for the OVN expression parser.
Upon investigation, it turned out that the expr_parse_target fuzzer was
 not being run by Google due to the said failure.

The root cause of the build failure turned out to be a change in the
definition of the expr_parse_string() API. Now, this API accepts an
additional parameter of type struct sset * that points to the set of
 address set referenced which may be NULL if unused.

This patch adds this additional parameter to expr_parse_string()
setting the pointer to the set of address set referenced to NULL.

Once this patch is applied, ossfuzz's expr_parse_target should build
 and subsequently be fuzzed.

Signed-off-by: Bhargava Shastry <bshastry@sect.tu-berlin.de>
---
 tests/oss-fuzz/expr_parse_target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff May 31, 2019, 5:03 p.m. UTC | #1
On Thu, May 30, 2019 at 12:38:23PM +0200, bshastry@sect.tu-berlin.de wrote:
> From: Bhargava Shastry <bshastry@sect.tu-berlin.de>
> 
> Google oss-fuzz reported a build failure for the OVN expression parser.
> Upon investigation, it turned out that the expr_parse_target fuzzer was
>  not being run by Google due to the said failure.
> 
> The root cause of the build failure turned out to be a change in the
> definition of the expr_parse_string() API. Now, this API accepts an
> additional parameter of type struct sset * that points to the set of
>  address set referenced which may be NULL if unused.
> 
> This patch adds this additional parameter to expr_parse_string()
> setting the pointer to the set of address set referenced to NULL.
> 
> Once this patch is applied, ossfuzz's expr_parse_target should build
>  and subsequently be fuzzed.
> 
> Signed-off-by: Bhargava Shastry <bshastry@sect.tu-berlin.de>

Thanks, applied to master.
diff mbox series

Patch

diff --git a/tests/oss-fuzz/expr_parse_target.c b/tests/oss-fuzz/expr_parse_target.c
index 1fdd3895b..7416421b8 100644
--- a/tests/oss-fuzz/expr_parse_target.c
+++ b/tests/oss-fuzz/expr_parse_target.c
@@ -359,7 +359,7 @@  test_parse_expr(const char *input)
     simap_put(&ports, "lsp3", 0x13);
 
     expr = expr_parse_string(input, &symtab, &addr_sets,
-                             &port_groups, &error);
+                             &port_groups, NULL, &error);
     if (!error) {
         expr = expr_annotate(expr, &symtab, &error);
     }