Skip to content

Commit

Permalink
Merge pull request elfmz#2512 from spnethw/tmppanel_fix_menu_from_fil…
Browse files Browse the repository at this point in the history
…e_list_crash

tmppanel: fix PANIC-PANIC crash in menu from file list
  • Loading branch information
elfmz authored Nov 20, 2024
2 parents 68a6021 + e4bc527 commit 63ae9f6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tmppanel/src/TmpPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,17 @@ void ReadFileLines(int fd, DWORD FileSizeLow, TCHAR **argv, TCHAR *args, UINT *n
for (int i = 0; i < argc; ++i) {
TCHAR *param, *p = TMP;
ExpandEnvStrs(argv[i], TMP);
param = ParseParam(p);
FSF.TruncStr(param ? param : p, 67);

fmi[i].Text = wcsdup(param ? param : p);
param = ParseParam(p);
if (!param) {
param = p;
}

fmi[i].Separator = !lstrcmp(param, _T("-"));
FSF.TruncStr(param, 67);
fmi[i].Text = wcsdup(param);
fmi[i].Separator = !lstrcmp(param, L"-");
fmi[i].Selected = FALSE;
fmi[i].Checked = FALSE;

}
// fmi[0].Selected=TRUE;

Expand All @@ -389,9 +392,10 @@ void ReadFileLines(int fd, DWORD FileSizeLow, TCHAR **argv, TCHAR *args, UINT *n
free(fmi);

if ((unsigned)ExitCode < (unsigned)argc) {
ExpandEnvStrs(argv[ExitCode], TMP);
TCHAR *p = TMP;
TCHAR *p = argv[ExitCode];
ParseParam(p);
ExpandEnvStrs(p, TMP);
p = TMP;

FAR_FIND_DATA FindData;
int bShellExecute = BreakCode != -1;
Expand Down Expand Up @@ -445,7 +449,7 @@ void ReadFileLines(int fd, DWORD FileSizeLow, TCHAR **argv, TCHAR *args, UINT *n
return hPlugin;
} else {
ShowMenuFromList(pName);
return INVALID_HANDLE_VALUE;
return ((HANDLE)-2);
}
#undef pName
}
Expand Down

0 comments on commit 63ae9f6

Please sign in to comment.