Skip to content

Commit 4c08290

Browse files
committed
decimal: Check negative mantissa overflow
1 parent 78b3bd1 commit 4c08290

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/textrdwr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub trait TextReader : Reader {
232232
let ReadInt { value, digit_cnt, is_overflow, .. } = self.read_int(mantissa, true)?;
233233
decimal_overflow = decimal_overflow || is_overflow;
234234
mantissa = value;
235-
if mantissa >= 0x80_0000_0000_0000 {
235+
if mantissa >= 0x80_0000_0000_0000 || mantissa < -0x80_0000_0000_0000 {
236236
decimal_overflow = true;
237237
}
238238
dec_cnt = i64::from(digit_cnt);

0 commit comments

Comments
 (0)