diff --git a/src/server/frontend_wayland/shm.cpp b/src/server/frontend_wayland/shm.cpp index 13fe5c715d..eb6505b95b 100644 --- a/src/server/frontend_wayland/shm.cpp +++ b/src/server/frontend_wayland/shm.cpp @@ -332,5 +332,13 @@ mf::Shm::Shm(wl_resource* resource, std::shared_ptr 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}; }