eric pouech (@epo) commented about programs/cmd/wcmdmain.c:
} else { + WCHAR* stem; /* Convert eg. ..\fred to include a directory by removing file part */ if (!WCMD_get_fullpath(firstParam, ARRAY_SIZE(pathtosearch), pathtosearch, NULL)) return ERROR_INVALID_FUNCTION; lastSlash = wcsrchr(pathtosearch, L'\\'); - sc->has_extension = wcschr(lastSlash ? lastSlash + 1 : firstParam, L'.') != NULL; - wcscpy(stemofsearch, lastSlash ? lastSlash + 1 : firstParam); + stem = lastSlash ? lastSlash + 1 : firstParam; + if (wcslen(stem) >= ARRAY_SIZE(stemofsearch)) + { + WCMD_output_asis_stderr(WCMD_LoadMessage(WCMD_LINETOOLONG));
this isn't what native does: * line too long is when input overflows the MAXSTRING limit, not the max_path * and the error message printed is about not being able to launch command which is currently handled in callers to this function) so just returning INVALID_FUNCTION should be fine -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10629#note_135860