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

layershell: check if layer is valid #9156

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

heather7283
Copy link
Contributor

Fixes compositor crash when client tried to create a layer surface with invalid layer argument

Describe your PR, what does it fix/add?

When playing around with wayland clients I noticed that hyprland would crash when I try to pass an invalid layer param, turns out it was causing out of bounds array access in

pMonitor->m_aLayerSurfaceLayers[resource->current.layer].emplace_back(pLS);

Basically copy pasted the check from

if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Nope

Is it ready for merging, or does it need work?

Ready

fixes compositor crash when client tried to create a layer surface with
invalid layer argument
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@vaxerski vaxerski merged commit 9b3f713 into hyprwm:main Jan 24, 2025
1 check passed
littleblack111 pushed a commit to littleblack111/Hyprland that referenced this pull request Jan 25, 2025
fixes compositor crash when client tried to create a layer surface with
invalid layer argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants