Jacek Caban (@jacek) commented about dlls/iertutil/uri.c:
- * it later. - */ - if(reduce_path && !path && ptr == uri->canon_uri+uri->path_start) - path = output+len; - - /* Check if it's time to reduce the path. */ - if(reduce_path && ptr == uri->canon_uri+uri->path_start+uri->path_len) { - DWORD current_path_len = (output+len) - path; - DWORD new_path_len = remove_dot_segments(path, current_path_len); + /* Reduce path first, otherwise it's difficult to check if the output will exceed + * output_len during escaping/unescaping. */ + if (reduce_path && uri->path_start > -1) + { + DWORD path_end, new_path_end; + path_end = uri->path_start+uri->path_len; + reduced = malloc(sizeof(WCHAR) * uri->canon_len); Please check for allocation failure.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8331#note_136772