[PATCH] ole32: Add parameter check for clipbrd_wndproc
On Fri, Mar 27, 2020 at 01:26:06PM +0800, Zhipeng Zhao wrote:
When I use wechat-work to do some clip, there raise a exception.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48826 Signed-off-by: Zhipeng Zhao <near2see(a)163.com> --- dlls/ole32/clipboard.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 9df37750a3..69a8fc61b2 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -2066,6 +2066,11 @@ static LRESULT CALLBACK clipbrd_wndproc(HWND hwnd, UINT message, WPARAM wparam, ole_priv_data_entry *entry;
TRACE("(): WM_RENDERFORMAT(cfFormat=%x)\n", cf); + if (!clipbrd || !clipbrd->cached_enum) + { + entry = NULL; + break; + } entry = find_format_in_list(clipbrd->cached_enum->entries, clipbrd->cached_enum->count, cf);
if(entry)
Could you debug this a bit further? Is clipbrd or clipbrd->cached_enum NULL? How does it get to this state? Thanks, Huw.
After debug a bit more, I see clipbrd->cached_enum is NULL not clipbrd.<br/>When using Ctrl + x to cut the picture in the wechat-work input box, and then switch another chat window, this time the crash appears.<br/><br/>Thanks,<br/>Zhipeng. At 2020-04-03 17:53:06, "Huw Davies" <huw(a)codeweavers.com> wrote:
On Fri, Mar 27, 2020 at 01:26:06PM +0800, Zhipeng Zhao wrote:
When I use wechat-work to do some clip, there raise a exception.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48826 Signed-off-by: Zhipeng Zhao <near2see(a)163.com> --- dlls/ole32/clipboard.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 9df37750a3..69a8fc61b2 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -2066,6 +2066,11 @@ static LRESULT CALLBACK clipbrd_wndproc(HWND hwnd, UINT message, WPARAM wparam, ole_priv_data_entry *entry;
TRACE("(): WM_RENDERFORMAT(cfFormat=%x)\n", cf); + if (!clipbrd || !clipbrd->cached_enum) + { + entry = NULL; + break; + } entry = find_format_in_list(clipbrd->cached_enum->entries, clipbrd->cached_enum->count, cf);
if(entry)
Could you debug this a bit further? Is clipbrd or clipbrd->cached_enum NULL? How does it get to this state?
Thanks, Huw.
participants (3)
-
Huw Davies -
Zhipeng Zhao -
Zhiyi Zhang