diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index a6a40834c..5ffae3691 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -87,7 +87,7 @@ static bool getShellVersionFish(FFstrbuf* exe, FFstrbuf* version) return false; //fish, version 4.0.2-1 (Built by MSYS2 project) // version can be localized if LC_ALL is set - if (!ffStrbufStartsWithS(version, "fish, ")) return false; + if (version->length < strlen("fish, v") || !ffStrbufStartsWithS(version, "fish")) return false; uint32_t index = ffStrbufNextIndexC(version, strlen("fish, "), ' '); ffStrbufSubstrAfter(version, index); ffStrbufSubstrBeforeFirstC(version, ' ');