[PATCH 0/1] MR1782: mshtml: Handle memory allocation failure in set_statustext.
From: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/mshtml/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c index 14c34f2f36a..a45a2c111dc 100644 --- a/dlls/mshtml/main.c +++ b/dlls/mshtml/main.c @@ -407,6 +407,7 @@ void set_statustext(HTMLDocumentObj* doc, INT id, LPCWSTR arg) if(!p) { len = 255; p = malloc(len * sizeof(WCHAR)); + if (!p) return; len = LoadStringW(hInst, id, p, len) + 1; p = realloc(p, len * sizeof(WCHAR)); if(InterlockedCompareExchangePointer((void**)&status_strings[index], p, NULL)) { @@ -420,6 +421,7 @@ void set_statustext(HTMLDocumentObj* doc, INT id, LPCWSTR arg) len = lstrlenW(p) + lstrlenW(arg) - 1; buf = malloc(len * sizeof(WCHAR)); + if (!buf) return; swprintf(buf, len, p, arg); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1782
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1782
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Jacek Caban (@jacek)