Skip to content

Commit

Permalink
Merge branch '2.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 13, 2024
2 parents ae7f199 + 61c2f1f commit 0801ba2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ public JsonToken nextToken() throws JacksonException
evt = _yamlParser.next();
} catch (org.snakeyaml.engine.v2.exceptions.YamlEngineException e) {
throw new JacksonYAMLParseException(this, e.getMessage(), e);
} catch (NumberFormatException e) {
// 12-Jan-2024, tatu: As per https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63274
// we seem to have unhandled case by SnakeYAML
throw _constructReadException(String.format(
"Malformed Number token: failed to tokenize due to (%s): %s",
e.getClass().getName(), e.getMessage()),
e);
}
// is null ok? Assume it is, for now, consider to be same as end-of-doc
if (evt == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.jackson.dataformat.yaml.failing;
package tools.jackson.dataformat.yaml.fuzz;

import tools.jackson.core.JacksonException;

Expand All @@ -11,7 +11,7 @@ public class FuzzYAMLRead63274Test extends ModuleTestBase
private final ObjectMapper MAPPER = newObjectMapper();

// https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63274
public void testReadBoundary63274() throws Exception
public void testMalformedNumber63274() throws Exception
{
// As bytes:
/*
Expand All @@ -36,9 +36,9 @@ public void testReadBoundary63274() throws Exception
try {
MAPPER.readTree(doc);
// Ok; don't care about content, just buffer reads
fail("Should not pass");
} catch (JacksonException e) {
// !!! TODO: proper checking of exception
verifyException(e, "foo");
verifyException(e, "Malformed Number token: failed to ");
}
}
}

0 comments on commit 0801ba2

Please sign in to comment.