1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

WindowServer: Mark clients as misbehaving when they send invalid data

If a client sends an invalid window ID or similar to the WindowServer,
we'll now immediately mark them as misbehaving and disconnect them.

This might be too aggressive in some cases (window management, ...)
but it's just a place to start.
This commit is contained in:
Andreas Kling 2019-12-02 15:55:14 +01:00
parent af9fd334f3
commit e91b2b8f1b
3 changed files with 70 additions and 74 deletions

View file

@ -128,6 +128,12 @@ public:
shutdown(); shutdown();
} }
void did_misbehave(const char* message)
{
dbg() << "Connection{" << this << "} (id=" << m_client_id << ", pid=" << m_client_pid << ") misbehaved (" << message << "), disconnecting.";
shutdown();
}
void shutdown() void shutdown()
{ {
m_socket->close(); m_socket->close();

View file

@ -59,12 +59,6 @@ void WSClientConnection::die()
s_connections->remove(client_id()); s_connections->remove(client_id());
} }
void WSClientConnection::post_error(const String& error_message)
{
dbgprintf("WSClientConnection::post_error: client_id=%d: %s\n", client_id(), error_message.characters());
did_misbehave();
}
void WSClientConnection::notify_about_new_screen_rect(const Rect& rect) void WSClientConnection::notify_about_new_screen_rect(const Rect& rect)
{ {
post_message(WindowClient::ScreenRectChanged(rect)); post_message(WindowClient::ScreenRectChanged(rect));
@ -88,8 +82,8 @@ OwnPtr<WindowServer::DestroyMenubarResponse> WSClientConnection::handle(const Wi
int menubar_id = message.menubar_id(); int menubar_id = message.menubar_id();
auto it = m_menubars.find(menubar_id); auto it = m_menubars.find(menubar_id);
if (it == m_menubars.end()) { if (it == m_menubars.end()) {
post_error("WSAPIDestroyMenubarRequest: Bad menubar ID"); did_misbehave("DestroyMenubar: Bad menubar ID");
return make<WindowServer::DestroyMenubarResponse>(); return nullptr;
} }
auto& menubar = *(*it).value; auto& menubar = *(*it).value;
WSWindowManager::the().close_menubar(menubar); WSWindowManager::the().close_menubar(menubar);
@ -111,8 +105,8 @@ OwnPtr<WindowServer::DestroyMenuResponse> WSClientConnection::handle(const Windo
int menu_id = message.menu_id(); int menu_id = message.menu_id();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
post_error("WSAPIDestroyMenuRequest: Bad menu ID"); did_misbehave("DestroyMenu: Bad menu ID");
return make<WindowServer::DestroyMenuResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
menu.close(); menu.close();
@ -126,8 +120,8 @@ OwnPtr<WindowServer::SetApplicationMenubarResponse> WSClientConnection::handle(c
int menubar_id = message.menubar_id(); int menubar_id = message.menubar_id();
auto it = m_menubars.find(menubar_id); auto it = m_menubars.find(menubar_id);
if (it == m_menubars.end()) { if (it == m_menubars.end()) {
post_error("WSAPISetApplicationMenubarRequest: Bad menubar ID"); did_misbehave("SetApplicationMenubar: Bad menubar ID");
return make<WindowServer::SetApplicationMenubarResponse>(); return nullptr;
} }
auto& menubar = *(*it).value; auto& menubar = *(*it).value;
m_app_menubar = menubar.make_weak_ptr(); m_app_menubar = menubar.make_weak_ptr();
@ -142,12 +136,12 @@ OwnPtr<WindowServer::AddMenuToMenubarResponse> WSClientConnection::handle(const
auto it = m_menubars.find(menubar_id); auto it = m_menubars.find(menubar_id);
auto jt = m_menus.find(menu_id); auto jt = m_menus.find(menu_id);
if (it == m_menubars.end()) { if (it == m_menubars.end()) {
post_error("WSAPIAddMenuToMenubarRequest: Bad menubar ID"); did_misbehave("AddMenuToMenubar: Bad menubar ID");
return make<WindowServer::AddMenuToMenubarResponse>(); return nullptr;
} }
if (jt == m_menus.end()) { if (jt == m_menus.end()) {
post_error("WSAPIAddMenuToMenubarRequest: Bad menu ID"); did_misbehave("AddMenuToMenubar: Bad menu ID");
return make<WindowServer::AddMenuToMenubarResponse>(); return nullptr;
} }
auto& menubar = *(*it).value; auto& menubar = *(*it).value;
auto& menu = *(*jt).value; auto& menu = *(*jt).value;
@ -161,17 +155,15 @@ OwnPtr<WindowServer::AddMenuItemResponse> WSClientConnection::handle(const Windo
unsigned identifier = message.identifier(); unsigned identifier = message.identifier();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
dbg() << "WSAPIAddMenuItemRequest: Bad menu ID: " << menu_id; dbg() << "AddMenuItem: Bad menu ID: " << menu_id;
return make<WindowServer::AddMenuItemResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
auto menu_item = make<WSMenuItem>(menu, identifier, message.text(), message.shortcut(), message.enabled(), message.checkable(), message.checked()); auto menu_item = make<WSMenuItem>(menu, identifier, message.text(), message.shortcut(), message.enabled(), message.checkable(), message.checked());
if (message.icon_buffer_id() != -1) { if (message.icon_buffer_id() != -1) {
auto icon_buffer = SharedBuffer::create_from_shared_buffer_id(message.icon_buffer_id()); auto icon_buffer = SharedBuffer::create_from_shared_buffer_id(message.icon_buffer_id());
if (!icon_buffer) { if (!icon_buffer)
did_misbehave(); return nullptr;
return make<WindowServer::AddMenuItemResponse>();
}
// FIXME: Verify that the icon buffer can accomodate a 16x16 bitmap view. // FIXME: Verify that the icon buffer can accomodate a 16x16 bitmap view.
auto shared_icon = GraphicsBitmap::create_with_shared_buffer(GraphicsBitmap::Format::RGBA32, icon_buffer.release_nonnull(), { 16, 16 }); auto shared_icon = GraphicsBitmap::create_with_shared_buffer(GraphicsBitmap::Format::RGBA32, icon_buffer.release_nonnull(), { 16, 16 });
menu_item->set_icon(shared_icon); menu_item->set_icon(shared_icon);
@ -187,8 +179,8 @@ OwnPtr<WindowServer::PopupMenuResponse> WSClientConnection::handle(const WindowS
auto position = message.screen_position(); auto position = message.screen_position();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
post_error("WSAPIPopupMenuRequest: Bad menu ID"); did_misbehave("PopupMenu: Bad menu ID");
return make<WindowServer::PopupMenuResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
menu.popup(position); menu.popup(position);
@ -200,8 +192,8 @@ OwnPtr<WindowServer::DismissMenuResponse> WSClientConnection::handle(const Windo
int menu_id = message.menu_id(); int menu_id = message.menu_id();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
post_error("WSAPIDismissMenuRequest: Bad menu ID"); did_misbehave("DismissMenu: Bad menu ID");
return make<WindowServer::DismissMenuResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
menu.close(); menu.close();
@ -213,14 +205,14 @@ OwnPtr<WindowServer::UpdateMenuItemResponse> WSClientConnection::handle(const Wi
int menu_id = message.menu_id(); int menu_id = message.menu_id();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
post_error("WSAPIUpdateMenuItemRequest: Bad menu ID"); did_misbehave("UpdateMenuItem: Bad menu ID");
return make<WindowServer::UpdateMenuItemResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
auto* menu_item = menu.item_with_identifier(message.identifier()); auto* menu_item = menu.item_with_identifier(message.identifier());
if (!menu_item) { if (!menu_item) {
post_error("WSAPIUpdateMenuItemRequest: Bad menu item identifier"); did_misbehave("UpdateMenuItem: Bad menu item identifier");
return make<WindowServer::UpdateMenuItemResponse>(); return nullptr;
} }
menu_item->set_text(message.text()); menu_item->set_text(message.text());
menu_item->set_shortcut_text(message.shortcut()); menu_item->set_shortcut_text(message.shortcut());
@ -236,8 +228,8 @@ OwnPtr<WindowServer::AddMenuSeparatorResponse> WSClientConnection::handle(const
int menu_id = message.menu_id(); int menu_id = message.menu_id();
auto it = m_menus.find(menu_id); auto it = m_menus.find(menu_id);
if (it == m_menus.end()) { if (it == m_menus.end()) {
post_error("WSAPIAddMenuSeparatorRequest: Bad menu ID"); did_misbehave("AddMenuSeparator: Bad menu ID");
return make<WindowServer::AddMenuSeparatorResponse>(); return nullptr;
} }
auto& menu = *(*it).value; auto& menu = *(*it).value;
menu.add_item(make<WSMenuItem>(menu, WSMenuItem::Separator)); menu.add_item(make<WSMenuItem>(menu, WSMenuItem::Separator));
@ -248,8 +240,8 @@ OwnPtr<WindowServer::MoveWindowToFrontResponse> WSClientConnection::handle(const
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIMoveWindowToFrontRequest: Bad window ID"); did_misbehave("MoveWindowToFront: Bad window ID");
return make<WindowServer::MoveWindowToFrontResponse>(); return nullptr;
} }
WSWindowManager::the().move_to_front_and_make_active(*(*it).value); WSWindowManager::the().move_to_front_and_make_active(*(*it).value);
return make<WindowServer::MoveWindowToFrontResponse>(); return make<WindowServer::MoveWindowToFrontResponse>();
@ -259,8 +251,8 @@ OwnPtr<WindowServer::SetFullscreenResponse> WSClientConnection::handle(const Win
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetFullscreenRequest: Bad window ID"); did_misbehave("SetFullscreen: Bad window ID");
return make<WindowServer::SetFullscreenResponse>(); return nullptr;
} }
it->value->set_fullscreen(message.fullscreen()); it->value->set_fullscreen(message.fullscreen());
return make<WindowServer::SetFullscreenResponse>(); return make<WindowServer::SetFullscreenResponse>();
@ -270,8 +262,8 @@ OwnPtr<WindowServer::SetWindowOpacityResponse> WSClientConnection::handle(const
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowOpacityRequest: Bad window ID"); did_misbehave("SetWindowOpacity: Bad window ID");
return make<WindowServer::SetWindowOpacityResponse>(); return nullptr;
} }
it->value->set_opacity(message.opacity()); it->value->set_opacity(message.opacity());
return make<WindowServer::SetWindowOpacityResponse>(); return make<WindowServer::SetWindowOpacityResponse>();
@ -299,8 +291,8 @@ OwnPtr<WindowServer::SetWindowTitleResponse> WSClientConnection::handle(const Wi
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowTitleRequest: Bad window ID"); did_misbehave("SetWindowTitle: Bad window ID");
return make<WindowServer::SetWindowTitleResponse>(); return nullptr;
} }
it->value->set_title(message.title()); it->value->set_title(message.title());
return make<WindowServer::SetWindowTitleResponse>(); return make<WindowServer::SetWindowTitleResponse>();
@ -310,8 +302,8 @@ OwnPtr<WindowServer::GetWindowTitleResponse> WSClientConnection::handle(const Wi
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIGetWindowTitleRequest: Bad window ID"); did_misbehave("GetWindowTitle: Bad window ID");
return make<WindowServer::GetWindowTitleResponse>(""); return nullptr;
} }
return make<WindowServer::GetWindowTitleResponse>(it->value->title()); return make<WindowServer::GetWindowTitleResponse>(it->value->title());
} }
@ -320,8 +312,8 @@ OwnPtr<WindowServer::SetWindowIconBitmapResponse> WSClientConnection::handle(con
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowIconBitmapRequest: Bad window ID"); did_misbehave("SetWindowIconBitmap: Bad window ID");
return make<WindowServer::SetWindowIconBitmapResponse>(); return nullptr;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -343,13 +335,13 @@ OwnPtr<WindowServer::SetWindowRectResponse> WSClientConnection::handle(const Win
int window_id = message.window_id(); int window_id = message.window_id();
auto it = m_windows.find(window_id); auto it = m_windows.find(window_id);
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowRectRequest: Bad window ID"); did_misbehave("SetWindowRect: Bad window ID");
return make<WindowServer::SetWindowRectResponse>(); return nullptr;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
if (window.is_fullscreen()) { if (window.is_fullscreen()) {
dbgprintf("WSClientConnection: Ignoring SetWindowRect request for fullscreen window\n"); dbg() << "WSClientConnection: Ignoring SetWindowRect request for fullscreen window";
return make<WindowServer::SetWindowRectResponse>(); return nullptr;
} }
window.set_rect(message.rect()); window.set_rect(message.rect());
window.request_update(message.rect()); window.request_update(message.rect());
@ -361,8 +353,8 @@ OwnPtr<WindowServer::GetWindowRectResponse> WSClientConnection::handle(const Win
int window_id = message.window_id(); int window_id = message.window_id();
auto it = m_windows.find(window_id); auto it = m_windows.find(window_id);
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIGetWindowRectRequest: Bad window ID"); did_misbehave("GetWindowRect: Bad window ID");
return make<WindowServer::GetWindowRectResponse>(Rect()); return nullptr;
} }
return make<WindowServer::GetWindowRectResponse>(it->value->rect()); return make<WindowServer::GetWindowRectResponse>(it->value->rect());
} }
@ -371,8 +363,8 @@ OwnPtr<WindowServer::SetClipboardContentsResponse> WSClientConnection::handle(co
{ {
auto shared_buffer = SharedBuffer::create_from_shared_buffer_id(message.shared_buffer_id()); auto shared_buffer = SharedBuffer::create_from_shared_buffer_id(message.shared_buffer_id());
if (!shared_buffer) { if (!shared_buffer) {
post_error("WSAPISetClipboardContentsRequest: Bad shared buffer ID"); did_misbehave("SetClipboardContents: Bad shared buffer ID");
return make<WindowServer::SetClipboardContentsResponse>(); return nullptr;
} }
WSClipboard::the().set_data(*shared_buffer, message.content_size(), message.content_type()); WSClipboard::the().set_data(*shared_buffer, message.content_size(), message.content_type());
return make<WindowServer::SetClipboardContentsResponse>(); return make<WindowServer::SetClipboardContentsResponse>();
@ -423,8 +415,8 @@ OwnPtr<WindowServer::DestroyWindowResponse> WSClientConnection::handle(const Win
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIDestroyWindowRequest: Bad window ID"); did_misbehave("DestroyWindow: Bad window ID");
return make<WindowServer::DestroyWindowResponse>(); return nullptr;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
WSWindowManager::the().invalidate(window); WSWindowManager::the().invalidate(window);
@ -453,7 +445,7 @@ void WSClientConnection::handle(const WindowServer::InvalidateRect& message)
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIInvalidateRectRequest: Bad window ID"); did_misbehave("InvalidateRect: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -466,7 +458,7 @@ void WSClientConnection::handle(const WindowServer::DidFinishPainting& message)
int window_id = message.window_id(); int window_id = message.window_id();
auto it = m_windows.find(window_id); auto it = m_windows.find(window_id);
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPIDidFinishPaintingNotification: Bad window ID"); did_misbehave("DidFinishPainting: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -481,8 +473,8 @@ OwnPtr<WindowServer::SetWindowBackingStoreResponse> WSClientConnection::handle(c
int window_id = message.window_id(); int window_id = message.window_id();
auto it = m_windows.find(window_id); auto it = m_windows.find(window_id);
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowBackingStoreRequest: Bad window ID"); did_misbehave("SetWindowBackingStore: Bad window ID");
return make<WindowServer::SetWindowBackingStoreResponse>(); return nullptr;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
if (window.last_backing_store() && window.last_backing_store()->shared_buffer_id() == message.shared_buffer_id()) { if (window.last_backing_store() && window.last_backing_store()->shared_buffer_id() == message.shared_buffer_id()) {
@ -509,8 +501,8 @@ OwnPtr<WindowServer::SetGlobalCursorTrackingResponse> WSClientConnection::handle
int window_id = message.window_id(); int window_id = message.window_id();
auto it = m_windows.find(window_id); auto it = m_windows.find(window_id);
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetGlobalCursorTrackingRequest: Bad window ID"); did_misbehave("SetGlobalCursorTracking: Bad window ID");
return make<WindowServer::SetGlobalCursorTrackingResponse>(); return nullptr;
} }
it->value->set_global_cursor_tracking_enabled(message.enabled()); it->value->set_global_cursor_tracking_enabled(message.enabled());
return make<WindowServer::SetGlobalCursorTrackingResponse>(); return make<WindowServer::SetGlobalCursorTrackingResponse>();
@ -520,8 +512,8 @@ OwnPtr<WindowServer::SetWindowOverrideCursorResponse> WSClientConnection::handle
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowOverrideCursorRequest: Bad window ID"); did_misbehave("SetWindowOverrideCursor: Bad window ID");
return make<WindowServer::SetWindowOverrideCursorResponse>(); return nullptr;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
window.set_override_cursor(WSCursor::create((WSStandardCursor)message.cursor_type())); window.set_override_cursor(WSCursor::create((WSStandardCursor)message.cursor_type()));
@ -532,8 +524,8 @@ OwnPtr<WindowServer::SetWindowHasAlphaChannelResponse> WSClientConnection::handl
{ {
auto it = m_windows.find(message.window_id()); auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) { if (it == m_windows.end()) {
post_error("WSAPISetWindowHasAlphaChannelRequest: Bad window ID"); did_misbehave("SetWindowHasAlphaChannel: Bad window ID");
return make<WindowServer::SetWindowHasAlphaChannelResponse>(); return nullptr;
} }
it->value->set_has_alpha_channel(message.has_alpha_channel()); it->value->set_has_alpha_channel(message.has_alpha_channel());
return make<WindowServer::SetWindowHasAlphaChannelResponse>(); return make<WindowServer::SetWindowHasAlphaChannelResponse>();
@ -543,12 +535,12 @@ void WSClientConnection::handle(const WindowServer::WM_SetActiveWindow& message)
{ {
auto* client = WSClientConnection::from_client_id(message.client_id()); auto* client = WSClientConnection::from_client_id(message.client_id());
if (!client) { if (!client) {
post_error("WSWMAPISetActiveWindowRequest: Bad client ID"); did_misbehave("WM_SetActiveWindow: Bad client ID");
return; return;
} }
auto it = client->m_windows.find(message.window_id()); auto it = client->m_windows.find(message.window_id());
if (it == client->m_windows.end()) { if (it == client->m_windows.end()) {
post_error("WSWMAPISetActiveWindowRequest: Bad window ID"); did_misbehave("WM_SetActiveWindow: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -560,12 +552,12 @@ void WSClientConnection::handle(const WindowServer::WM_PopupWindowMenu& message)
{ {
auto* client = WSClientConnection::from_client_id(message.client_id()); auto* client = WSClientConnection::from_client_id(message.client_id());
if (!client) { if (!client) {
post_error("WSWMAPIPopupWindowMenuRequest: Bad client ID"); did_misbehave("WM_PopupWindowMenu: Bad client ID");
return; return;
} }
auto it = client->m_windows.find(message.window_id()); auto it = client->m_windows.find(message.window_id());
if (it == client->m_windows.end()) { if (it == client->m_windows.end()) {
post_error("WSWMAPIPopupWindowMenuRequest: Bad window ID"); did_misbehave("WM_PopupWindowMenu: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -576,12 +568,12 @@ void WSClientConnection::handle(const WindowServer::WM_StartWindowResize& reques
{ {
auto* client = WSClientConnection::from_client_id(request.client_id()); auto* client = WSClientConnection::from_client_id(request.client_id());
if (!client) { if (!client) {
post_error("WSWMAPIStartWindowResizeRequest: Bad client ID"); did_misbehave("WM_StartWindowResize: Bad client ID");
return; return;
} }
auto it = client->m_windows.find(request.window_id()); auto it = client->m_windows.find(request.window_id());
if (it == client->m_windows.end()) { if (it == client->m_windows.end()) {
post_error("WSWMAPIStartWindowResizeRequest: Bad window ID"); did_misbehave("WM_StartWindowResize: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;
@ -594,12 +586,12 @@ void WSClientConnection::handle(const WindowServer::WM_SetWindowMinimized& messa
{ {
auto* client = WSClientConnection::from_client_id(message.client_id()); auto* client = WSClientConnection::from_client_id(message.client_id());
if (!client) { if (!client) {
post_error("WSWMAPISetWindowMinimizedRequest: Bad client ID"); did_misbehave("WM_SetWindowMinimized: Bad client ID");
return; return;
} }
auto it = client->m_windows.find(message.window_id()); auto it = client->m_windows.find(message.window_id());
if (it == client->m_windows.end()) { if (it == client->m_windows.end()) {
post_error("WSWMAPISetWindowMinimizedRequest: Bad window ID"); did_misbehave("WM_SetWindowMinimized: Bad window ID");
return; return;
} }
auto& window = *(*it).value; auto& window = *(*it).value;

View file

@ -87,8 +87,6 @@ private:
virtual OwnPtr<WindowServer::DismissMenuResponse> handle(const WindowServer::DismissMenu&) override; virtual OwnPtr<WindowServer::DismissMenuResponse> handle(const WindowServer::DismissMenu&) override;
virtual OwnPtr<WindowServer::SetWindowIconBitmapResponse> handle(const WindowServer::SetWindowIconBitmap&) override; virtual OwnPtr<WindowServer::SetWindowIconBitmapResponse> handle(const WindowServer::SetWindowIconBitmap&) override;
void post_error(const String&);
HashMap<int, NonnullRefPtr<WSWindow>> m_windows; HashMap<int, NonnullRefPtr<WSWindow>> m_windows;
HashMap<int, NonnullOwnPtr<WSMenuBar>> m_menubars; HashMap<int, NonnullOwnPtr<WSMenuBar>> m_menubars;
HashMap<int, NonnullRefPtr<WSMenu>> m_menus; HashMap<int, NonnullRefPtr<WSMenu>> m_menus;