From 081abd306e67395a02390e5dc16dafb2a62a0a20 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Sat, 5 Aug 2023 16:39:22 +0100 Subject: [PATCH] rdf4j: Fix exception handling for ParserFuzzer (#10796) In https://github.com/eclipse/rdf4j/blob/main/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/BaseDeclProcessor.java#L73, the method throws an IllegalArgumentException when the input does not fulfil some of the conditions which could happen when we fuzz the project. This PR fixes the fuzzer by capturing the exception. Signed-off-by: Arthur Chan --- projects/rdf4j/ParserFuzzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rdf4j/ParserFuzzer.java b/projects/rdf4j/ParserFuzzer.java index a4a83d9fb..a820b210a 100644 --- a/projects/rdf4j/ParserFuzzer.java +++ b/projects/rdf4j/ParserFuzzer.java @@ -28,7 +28,7 @@ public class ParserFuzzer { SPARQLParser obj = new SPARQLParser(); obj.parseQuery( data.consumeString(data.remainingBytes() / 2), data.consumeRemainingAsString()); - } catch (MalformedQueryException e1) { + } catch (MalformedQueryException | IllegalArgumentException e1) { } } }