tsrm_realpath_r for win32 mountpoints copy little optimisations. (#14852)

This commit is contained in:
David CARLIER 2024-07-08 20:31:12 +01:00 committed by GitHub
parent 9e94d2b040
commit 479707b4d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -713,7 +713,7 @@ retry_reparse_tag_cloud:
FREE_PATHW() FREE_PATHW()
return (size_t)-1; return (size_t)-1;
} }
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength); memcpy(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
tmpsubstname[substitutename_len] = L'\0'; tmpsubstname[substitutename_len] = L'\0';
substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len); substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len);
if (!substitutename || substitutename_len >= MAXPATHLEN) { if (!substitutename || substitutename_len >= MAXPATHLEN) {
@ -748,7 +748,7 @@ retry_reparse_tag_cloud:
FREE_PATHW() FREE_PATHW()
return (size_t)-1; return (size_t)-1;
} }
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength); memcpy(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
tmpsubstname[substitutename_len] = L'\0'; tmpsubstname[substitutename_len] = L'\0';
substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len); substitutename = php_win32_cp_conv_w_to_any(tmpsubstname, substitutename_len, &substitutename_len);
if (!substitutename || substitutename_len >= MAXPATHLEN) { if (!substitutename || substitutename_len >= MAXPATHLEN) {