mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 23:12:56 +00:00
WindowServer: Add sanity checks to create_window
IPC
This commit is contained in:
parent
ef92493aba
commit
0ff09d4f74
Notes:
sideshowbarker
2024-07-18 16:58:22 +09:00
Author: https://github.com/matthewbjones
Commit: 0ff09d4f74
Pull-request: https://github.com/SerenityOS/serenity/pull/7721
Issue: https://github.com/SerenityOS/serenity/issues/4540
3 changed files with 10 additions and 2 deletions
|
@ -465,6 +465,11 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
|||
}
|
||||
}
|
||||
|
||||
if (type < 0 || type >= (i32)WindowType::_Count) {
|
||||
did_misbehave("CreateWindow with a bad type");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int window_id = m_next_window_id++;
|
||||
auto window = Window::construct(*this, (WindowType)type, window_id, modal, minimizable, frameless, resizable, fullscreen, accessory, parent_window);
|
||||
|
||||
|
@ -492,7 +497,8 @@ Messages::WindowServer::CreateWindowResponse ClientConnection::create_window(Gfx
|
|||
window->set_alpha_hit_threshold(alpha_hit_threshold);
|
||||
window->set_size_increment(size_increment);
|
||||
window->set_base_size(base_size);
|
||||
window->set_resize_aspect_ratio(resize_aspect_ratio);
|
||||
if (resize_aspect_ratio.has_value() && !resize_aspect_ratio.value().is_null())
|
||||
window->set_resize_aspect_ratio(resize_aspect_ratio);
|
||||
window->invalidate(true, true);
|
||||
if (window->type() == WindowType::Applet)
|
||||
AppletManager::the().add_applet(*window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue