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
join: save the delimiter string before anything magical happens to it
This code had a few problems:
- changes to the content of delim from set or overload magic could
result in the separator between elements changing during the
process of the join.
- changes to the content of delim which allocated a new PVX
resulted in access to freed memory
- changes to the flags of delim, the UTF-8 flag in particular, could
result in an invalid joined string, either mojibake or an invalidly
encoded upgraded string
To avoid that, we copy the separator, either into a local buffer
if it's large enough, or an allocated buffer, and save the flag we
use, to prevent changes to the delim SV from changing or invalidating
the delimpv value.
Fixes#21458 and some similar problems.
0 commit comments