Shell (Windows): fixes possible buffer overflow

This commit is contained in:
Carter Li
2026-09-25 11:32:56 +08:00
parent 93175aea1d
commit d8797ae314
@@ -348,8 +348,8 @@ const FFShellResult* ffDetectShell(void) {
if (result->processName.length > 0) {
setShellInfoDetails(result);
char tmp[MAX_PATH];
strcpy(tmp, result->exeName);
char* ext = strrchr(tmp, '.');
char* end = ffStrCopy(tmp, result->exeName, sizeof(tmp));
char* ext = (char*) memrchr(tmp, '.', (size_t) (end - tmp));
if (ext) {
*ext = '\0';
}