From 22c941296ecb1185f528cc8a88b72fd49ebeb446 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Mon, 4 Dec 2023 18:50:27 +0000 Subject: [PATCH] jackson-datatypes-collections: Catch known exceptions (#11310) This PR catches some known exceptions which are missed before. This PR solves https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64612, https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64614, https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64640 and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64642. Signed-off-by: Arthur Chan --- .../EclipseCollectionsDeserializerFuzzer.java | 2 +- .../jackson-datatypes-collections/GuavaDeserializerFuzzer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/jackson-datatypes-collections/EclipseCollectionsDeserializerFuzzer.java b/projects/jackson-datatypes-collections/EclipseCollectionsDeserializerFuzzer.java index 0ae2e46b2..b4da4193a 100644 --- a/projects/jackson-datatypes-collections/EclipseCollectionsDeserializerFuzzer.java +++ b/projects/jackson-datatypes-collections/EclipseCollectionsDeserializerFuzzer.java @@ -38,7 +38,7 @@ public class EclipseCollectionsDeserializerFuzzer { String value = data.consumeRemainingAsString(); mapper.readValue(value, type); mapper.readTree(value); - } catch (IOException e) { + } catch (IOException | IllegalArgumentException e) { // Known exception } } diff --git a/projects/jackson-datatypes-collections/GuavaDeserializerFuzzer.java b/projects/jackson-datatypes-collections/GuavaDeserializerFuzzer.java index dd3afeaed..a96901254 100644 --- a/projects/jackson-datatypes-collections/GuavaDeserializerFuzzer.java +++ b/projects/jackson-datatypes-collections/GuavaDeserializerFuzzer.java @@ -65,7 +65,7 @@ public class GuavaDeserializerFuzzer { TypeReference type = data.pickValue(choice); String value = data.consumeRemainingAsString(); mapper.readValue(value, type); - } catch (IOException e) { + } catch (IOException | IllegalArgumentException e) { // Known exception } }