From 7ca30eccc96e8eb02bc6b1a4aab3d78c1bba1388 Mon Sep 17 00:00:00 2001 From: Emily Selwood Date: Fri, 8 Nov 2019 18:37:23 +0000 Subject: [PATCH] array index out of bounds in hex lookup (#578) --- .../java/com/fasterxml/jackson/core/io/TestCharTypes.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/com/fasterxml/jackson/core/io/TestCharTypes.java b/src/test/java/com/fasterxml/jackson/core/io/TestCharTypes.java index b862b52942..fc1704f97a 100644 --- a/src/test/java/com/fasterxml/jackson/core/io/TestCharTypes.java +++ b/src/test/java/com/fasterxml/jackson/core/io/TestCharTypes.java @@ -20,4 +20,12 @@ public void testAppendQuoted0_31 () assertEquals(expected, actual); } } + + public void testHexOutOfRange() + { + final int[] inputs = {0, -1, 1, 129, -129}; + for (int input : inputs) { + assertEquals(-1, CharTypes.charToHex(input)); + } + } }