Skip to content

Commit 8c57358

Browse files
authored
browser(webkit): fix null pointer access (#1099)
1 parent ba29470 commit 8c57358

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

browser_patches/webkit/BUILD_NUMBER

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1154
1+
1155

browser_patches/webkit/patches/bootstrap.diff

+19-9
Original file line numberDiff line numberDiff line change
@@ -12092,7 +12092,7 @@ index d996feb64e02d7399f2ed0b34d3d0dd03133f824..4ab1fa69437ed5a11a5357a331cb7e1c
1209212092
CommandLineOptions()
1209312093
#if ENABLE(WEBKIT)
1209412094
diff --git a/Tools/MiniBrowser/win/MainWindow.cpp b/Tools/MiniBrowser/win/MainWindow.cpp
12095-
index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d505f1161 100644
12095+
index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..bfe54fa7c027b75c470ad2da4c5f83f2250cbb7e 100644
1209612096
--- a/Tools/MiniBrowser/win/MainWindow.cpp
1209712097
+++ b/Tools/MiniBrowser/win/MainWindow.cpp
1209812098
@@ -102,7 +102,10 @@ bool MainWindow::isInstance(HWND hwnd)
@@ -12179,7 +12179,17 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1217912179

1218012180
if (m_browserWindow->usesLayeredWebView() || !m_browserWindow->hwnd())
1218112181
return;
12182-
@@ -309,17 +321,15 @@ LRESULT CALLBACK MainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
12182+
@@ -254,6 +266,9 @@ LRESULT CALLBACK MainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
12183+
{
12184+
LRESULT result = 0;
12185+
RefPtr<MainWindow> thisWindow = reinterpret_cast<MainWindow*>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
12186+
+ if (!thisWindow && message != WM_CREATE)
12187+
+ return DefWindowProc(hWnd, message, wParam, lParam);
12188+
+
12189+
switch (message) {
12190+
case WM_ACTIVATE:
12191+
switch (LOWORD(wParam)) {
12192+
@@ -309,17 +324,15 @@ LRESULT CALLBACK MainWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
1218312193
break;
1218412194
#if ENABLE(WEBKIT)
1218512195
case IDM_NEW_WEBKIT_WINDOW: {
@@ -12199,7 +12209,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1219912209
break;
1220012210
}
1220112211
#endif
12202-
@@ -443,6 +453,9 @@ void MainWindow::setDefaultURLToCurrentURL()
12212+
@@ -443,6 +456,9 @@ void MainWindow::setDefaultURLToCurrentURL()
1220312213

1220412214
bool MainWindow::toggleMenuItem(UINT menuID)
1220512215
{
@@ -12209,7 +12219,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1220912219
HMENU menu = ::GetMenu(hwnd());
1221012220

1221112221
switch (menuID) {
12212-
@@ -519,6 +532,8 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
12222+
@@ -519,6 +535,8 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
1221312223
INT_PTR CALLBACK MainWindow::cachesDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
1221412224
{
1221512225
MainWindow& thisWindow = *reinterpret_cast<MainWindow*>(GetWindowLongPtr(hDlg, DWLP_USER));
@@ -12218,7 +12228,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1221812228
switch (message) {
1221912229
case WM_INITDIALOG:
1222012230
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
12221-
@@ -549,6 +564,8 @@ INT_PTR CALLBACK MainWindow::cachesDialogProc(HWND hDlg, UINT message, WPARAM wP
12231+
@@ -549,6 +567,8 @@ INT_PTR CALLBACK MainWindow::cachesDialogProc(HWND hDlg, UINT message, WPARAM wP
1222212232
INT_PTR CALLBACK MainWindow::customUserAgentDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
1222312233
{
1222412234
MainWindow& thisWindow = *reinterpret_cast<MainWindow*>(GetWindowLongPtr(hDlg, DWLP_USER));
@@ -12227,7 +12237,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1222712237
switch (message) {
1222812238
case WM_INITDIALOG: {
1222912239
MainWindow& thisWindow = *reinterpret_cast<MainWindow*>(lParam);
12230-
@@ -594,27 +611,26 @@ void MainWindow::loadURL(std::wstring url)
12240+
@@ -594,27 +614,26 @@ void MainWindow::loadURL(std::wstring url)
1223112241
if (SUCCEEDED(::UrlCreateFromPath(url.c_str(), fileURL, &fileURLLength, 0)))
1223212242
url = fileURL;
1223312243
}
@@ -12261,7 +12271,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1226112271
wchar_t url[INTERNET_MAX_URL_LENGTH];
1226212272
GetWindowText(m_hURLBarWnd, url, INTERNET_MAX_URL_LENGTH);
1226312273
loadURL(url);
12264-
@@ -622,6 +638,8 @@ void MainWindow::onURLBarEnter()
12274+
@@ -622,6 +641,8 @@ void MainWindow::onURLBarEnter()
1226512275

1226612276
void MainWindow::updateDeviceScaleFactor()
1226712277
{
@@ -12270,7 +12280,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1227012280
if (m_hURLBarFont)
1227112281
::DeleteObject(m_hURLBarFont);
1227212282

12273-
@@ -638,6 +656,8 @@ void MainWindow::updateDeviceScaleFactor()
12283+
@@ -638,6 +659,8 @@ void MainWindow::updateDeviceScaleFactor()
1227412284

1227512285
void MainWindow::progressChanged(double progress)
1227612286
{
@@ -12279,7 +12289,7 @@ index 08131e61107bc4163c4fb1e9a65ee5a1ecda6b04..57d3b3662c4f31dba750a340b628744d
1227912289
std::wostringstream text;
1228012290
text << static_cast<int>(progress * 100) << L'%';
1228112291
SetWindowText(m_hProgressIndicator, text.str().c_str());
12282-
@@ -645,10 +665,14 @@ void MainWindow::progressChanged(double progress)
12292+
@@ -645,10 +668,14 @@ void MainWindow::progressChanged(double progress)
1228312293

1228412294
void MainWindow::progressFinished()
1228512295
{

0 commit comments

Comments
 (0)