You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] utf8_slice_codeunits returns wrong results with extreme start or step #55509
start isn't clamped, and adding step overflows when step is near INT64_MIN/INT64_MAX. In the first example, 3 - 1 + INT64_MAX - 1 wraps, the estimate comes out as 0, and the 1-byte result is written to a 0-byte buffer. A Debug + UBSan build of main reports signed integer overflow on that line for all four cases.
#36575 fixed the same overflow for the default stop, and binary_slice is being fixed in GH-51222 / #52451. The only documented constraint on SliceOptions is that step is non-zero, and sys.maxsize is the suggested way to slice to the end (#28940, #34917).
AI disclosure: I used an AI assistant to help find and reproduce this, and I checked the results myself.
Hello...
I would like to work on this issue. I noticed that PR #54510 addressed the overflow problem in SliceCodeunitsTransform, but it was closed due to a limit on the number of concurrent open PRs.
Before I begin, I’d like to know: is that PR going to be reopened, or would you welcome a new solution for issue #55509?
If this issue is still open and available for work, I would be happy to take it on and add regression tests.
Tnx
Activity
emadleo13 commentedon Nov 16, 2026
Hello...
I would like to work on this issue. I noticed that PR #54510 addressed the overflow problem in
SliceCodeunitsTransform, but it was closed due to a limit on the number of concurrent open PRs.Before I begin, I’d like to know: is that PR going to be reopened, or would you welcome a new solution for issue #55509?
If this issue is still open and available for work, I would be happy to take it on and add regression tests.
Tnx