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 <arthur.chan@adalogics.com>
This commit is contained in:
Arthur Chan 2023-08-05 16:39:22 +01:00 committed by GitHub
parent ae5ed8e758
commit 081abd306e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) {
}
}
}