Skip to content

Conversation

@otaxhu
Copy link
Contributor

@otaxhu otaxhu commented May 16, 2025

Fixes #2053

@otaxhu otaxhu requested a review from bilelmoussaoui as a code owner May 16, 2025 20:09
@otaxhu
Copy link
Contributor Author

otaxhu commented May 16, 2025

Ready for review @bilelmoussaoui

Comment on lines 3 to 8
#[allow(unused_imports)]
use glib::translate::*;

use crate::prelude::*;
#[allow(unused_imports)]
use crate::{ffi, EventController};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[allow(unused_imports)]
use glib::translate::*;
use crate::prelude::*;
#[allow(unused_imports)]
use crate::{ffi, EventController};
#[cfg(feature = "v4_8")]
use glib::translate::*;
#[cfg(feature = "v4_8")]
use crate::{ffi, prelude::*, EventController};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

prelude::* needs to be in scope in order for IsA<EventController> to work

gtk4/Gir.toml Outdated
[[object.function]]
name = "set_static_name"
manual = true # to make use of a static lifetimed string
doc_trait_name = "EventControllerExtManual"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
doc_trait_name = "EventControllerExtManual"

@bilelmoussaoui
Copy link
Member

Please rebase for the CI to pass.

@bilelmoussaoui
Copy link
Member

& squash the commits into a single one.

@otaxhu otaxhu force-pushed the set_static_name-UAF branch from dbc1b29 to 153b159 Compare May 16, 2025 21:50
@otaxhu otaxhu marked this pull request as draft May 17, 2025 18:02
@otaxhu
Copy link
Contributor Author

otaxhu commented May 17, 2025

PR converted to draft due what @sdroege commented #2056 (comment)

@otaxhu otaxhu marked this pull request as ready for review May 19, 2025 14:55
@bilelmoussaoui bilelmoussaoui merged commit 5db1b59 into gtk-rs:main May 19, 2025
41 checks passed
@otaxhu otaxhu deleted the set_static_name-UAF branch May 20, 2025 02:28
sdroege added a commit to sdroege/gtk4-rs that referenced this pull request Jun 20, 2025
…rs#2056)

* fix(event_controller): set_static_name UAF fixed, name now has static lifetime

* fix(event_controller): using GStr instead of str

Co-authored-by: Sebastian Dröge <[email protected]>

---------

Co-authored-by: Sebastian Dröge <[email protected]>
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.

EventControllerKey.set_static_name SEGFAULT

3 participants