mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
54fbf6c3ec
When right-shifting by more bits than the number contains, the loop condition `i < x->sz - digs` would underflow (since size_t is unsigned), causing out-of-bounds memory access. Fixed by checking if digs >= x->sz upfront and returning zero in that case, since shifting right by more bits than the number has always yields zero. Discovered via ClusterFuzz with input "7<<78<<-772". Co-authored-by: Claude <noreply@anthropic.com>