metsw24-max opened a new issue, #50057:
URL: https://github.com/apache/arrow/issues/50057

   `Decimal{32,64,128,256}::FromString` parse the exponent with 
`ParseValue<Int32Type>`, so it can be any `int32_t` including `INT32_MIN`. 
`DecimalFromString`/`SimpleDecimalFromString` in 
`cpp/src/arrow/util/decimal.cc` then compute `parsed_scale = -adjusted_exponent 
+ fractional_digits`. For an input like `0E-2147483648` the negation of 
`INT32_MIN` is signed-integer-overflow UB; a near-`INT32_MIN` exponent 
overflows the addition.
   
   UBSan on the expression:
   
   ```
   decimal.cc: runtime error: negation of -2147483648 cannot be represented in 
type 'int32_t' (aka 'int')
   ```
   
   These are public string-parsing entry points reachable from the CSV/JSON 
readers when converting decimal columns, so the input crosses a trust boundary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to