This fixes a stack overflow in Helicon Focus 8.2.0, which was introduced by b5cbb556.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57293
I'm unsure if this is actually the proper way to approach this problem, since an application being so close to a stack overflow that an allocation of wchar_t[MAX_PATH] (=260*2 bytes) is making the difference between crashing and not crashing might be an issue in itself.
However, the crash was introduced by adding this allocation (or rather, changing the condition for it to happen) in previous commit, so for now I think the proper solution would be to move it to the heap instead.
-- v2: comdlg32: Allocate extbuf on heap rather than stack.
From: Charlotte Pabst cpabst@codeweavers.com
This fixes a stack overflow in Helicon Focus 8.2.0, which was introduced by b5cbb556.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57293 --- dlls/comdlg32/itemdlg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/comdlg32/itemdlg.c b/dlls/comdlg32/itemdlg.c index 784a14b47e4..b431cf9d544 100644 --- a/dlls/comdlg32/itemdlg.c +++ b/dlls/comdlg32/itemdlg.c @@ -646,7 +646,8 @@ static HRESULT on_default_action(FileDialogImpl *This) /* Add the proper extension */ if(open_action == ONOPEN_OPEN) { - WCHAR extbuf[MAX_PATH], *newext = NULL; + WCHAR *extbuf, *newext = NULL; + extbuf = malloc(sizeof(WCHAR) * MAX_PATH);
if(This->current_filter) { @@ -691,6 +692,8 @@ static HRESULT on_default_action(FileDialogImpl *This) } } } + + free(extbuf); } else if (open_action == ONOPEN_SEARCH) { filter = fn_iter; }
Sorry, I've completely misdiagnosed the problem. There is no stack overflow, this is not the proper fix.
This merge request was closed by Charlotte Pabst.