kosiew commented on code in PR #20816:
URL: https://github.com/apache/datafusion/pull/20816#discussion_r2910021065


##########
datafusion/core/src/execution/context/mod.rs:
##########


Review Comment:
   `parse_duration` is doing unchecked `u64` arithmetic when combining minutes 
and seconds:
   
   For large inputs such as `SET datafusion.runtime.list_files_cache_ttl = 
'307445734561825861m'`, `minutes * 60` overflows before `Duration::from_secs` 
is reached. In debug/test builds that panics instead of returning a planning 
error.
   
   This means malformed user input can still crash the statement path rather 
than producing a DataFusion error. 
   This needs an overflow-checked path (`checked_mul` / `checked_add`) and a 
test that exercises the oversized value through `SET`.
   
   Extract a small helper for the checked accumulation here so the parser logic 
stays readable and the overflow error can consistently include `config_name`.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to