diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index 462cd1371..7dc9caf68 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -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'; }