mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Shell (Windows): fixes possible buffer overflow
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user