-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f798ced
commit 01fe76a
Showing
5 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
smile/src/test/java/com/fasterxml/jackson/dataformat/smile/fuzz/Fuzz3168BigDecimalTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.fasterxml.jackson.dataformat.smile.fuzz; | ||
|
||
import com.fasterxml.jackson.core.exc.StreamReadException; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import com.fasterxml.jackson.dataformat.smile.BaseTestForSmile; | ||
|
||
public class Fuzz3168BigDecimalTest extends BaseTestForSmile | ||
{ | ||
private final ObjectMapper MAPPER = smileMapper(); | ||
|
||
// Payload: | ||
public void testInvalidBigDecimal() throws Exception | ||
{ | ||
final byte[] input = new byte[] { | ||
0x3A, 0x29, 0x0A, 0x00, // smile signature | ||
0x2A, // BigDecimal | ||
(byte) 0xBF, // scale: -32 | ||
(byte) 0x80 // length: 0 (invalid | ||
}; | ||
try { | ||
/*JsonNode root =*/ MAPPER.readTree(input); | ||
fail("Should not pass"); | ||
} catch (StreamReadException e) { | ||
verifyException(e, "Invalid encoding of `BigDecimal` value: length 0"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters