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.
Activity