dxbjavid commented on PR #13835: URL: https://github.com/apache/trafficserver/pull/13835#issuecomment-6461867338
Fair point, I'd misread the slice semantics. I've taken your suggestion: it slices against escaped_len again with start as a raw position, and the read is bounded by val_len - offset, so [2:5] goes back to returning nothing. I've also swapped in your two test cases, trimmed the comments to the single line above escape_json, and corrected the description, since the non-slice change is only a cleanup. One small difference: the expected strings in your test suggestion came through as \\^A, so I've used \\u0001\\u0001, which is what escape_json actually emits for 0x01. I couldn't configure the full tree on this machine (pcre2 is missing), so I checked unmarshal_str_json and escape_json on their own under ASan with the four slice cases. The pre-fix code overflows on [8:60] and the new code is clean, but the in-tree Catch2 run will need CI to confirm it. -- 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]
