Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: throwing an invalid_stride error when the size provided to wl_shm::create_pool is less than or equal to zero #3674

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/server/frontend_wayland/shm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,5 +332,13 @@ mf::Shm::Shm(wl_resource* resource, std::shared_ptr<Executor> wayland_executor)

void mf::Shm::create_pool(wl_resource* id, Fd fd, int32_t size)
{
if (size <= 0)
{
throw wayland::ProtocolError{
resource,
wayland::Shm::Error::invalid_stride,
"Invalid requested size"};
}

new ShmPool{id, wayland_executor, fd, size};
}
Loading