public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-glib] epel10: Backport upstreamed patch to fix UB in VariantStr::impl_get
@ 2026-09-25 10:37 Fabio Valentini
  0 siblings, 0 replies; only message in thread
From: Fabio Valentini @ 2026-09-25 10:37 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rust-glib
Branch : epel10
Commit : d2f944aebdd8217795dab1769418fde42dea7fc2
Author : Fabio Valentini <decathorpe@gmail.com>
Date   : 2024-04-03T19:51:40+02:00
Stats  : +37/-6 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/rust-glib/c/d2f944aebdd8217795dab1769418fde42dea7fc2?branch=epel10

Log:
Backport upstreamed patch to fix UB in VariantStr::impl_get

---
diff --git a/0001-fix-UB-in-VariantStrIter-impl_get.patch b/0001-fix-UB-in-VariantStrIter-impl_get.patch
new file mode 100644
index 0000000..faeec7d
--- /dev/null
+++ b/0001-fix-UB-in-VariantStrIter-impl_get.patch
@@ -0,0 +1,32 @@
+From 7667e5f8347df7579655bfcf99e65c2987b6fa08 Mon Sep 17 00:00:00 2001
+From: Fabio Valentini <decathorpe@gmail.com>
+Date: Wed, 3 Apr 2024 19:46:42 +0200
+Subject: [PATCH] fix UB in VariantStrIter::impl_get
+
+---
+ src/variant_iter.rs | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/variant_iter.rs b/src/variant_iter.rs
+index b406172..e0997f6 100644
+--- a/src/variant_iter.rs
++++ b/src/variant_iter.rs
+@@ -117,13 +117,13 @@ impl<'a> VariantStrIter<'a> {
+ 
+     fn impl_get(&self, i: usize) -> &'a str {
+         unsafe {
+-            let p: *mut libc::c_char = std::ptr::null_mut();
++            let mut p: *mut libc::c_char = std::ptr::null_mut();
+             let s = b"&s\0";
+             ffi::g_variant_get_child(
+                 self.variant.to_glib_none().0,
+                 i,
+                 s as *const u8 as *const _,
+-                &p,
++                &mut p,
+                 std::ptr::null::<i8>(),
+             );
+             let p = std::ffi::CStr::from_ptr(p);
+-- 
+2.44.0
+

diff --git a/rust-glib.spec b/rust-glib.spec
index 2b6d35a..6aecd84 100644
--- a/rust-glib.spec
+++ b/rust-glib.spec
@@ -15,6 +15,9 @@ Source:         %{crates_source}
 # Manually created patch for downstream crate metadata changes
 # * drop unused, benchmark-only criterion dev-dependency
 Patch:          glib-fix-metadata.diff
+# * backport upstreamed patch to fix UB in VariantStr::impl_get:
+#   https://github.com/gtk-rs/gtk-rs-core/pull/1343
+Patch:          0001-fix-UB-in-VariantStrIter-impl_get.patch
 
 BuildRequires:  cargo-rpm-macros >= 24
 
@@ -286,7 +289,7 @@ rm -r tests/regex_compiletest/
 %check
 # * skip tests that crash when built with Fedora rustc
 # * skip a test that only works when run in-tree
-%cargo_test -- -- --skip variant_iter::tests::test_variant_iter_array --skip variant_iter::tests::test_variant_str_iter_last --skip variant_iter::tests::test_variant_str_iter_nth --skip variant::Variant::array_iter_str --skip structured_log
+%cargo_test -- -- --exact --skip structured_log
 %endif
 
 %changelog

diff --git a/rust2rpm.toml b/rust2rpm.toml
index d5c44fc..6705534 100644
--- a/rust2rpm.toml
+++ b/rust2rpm.toml
@@ -3,14 +3,10 @@ cargo-toml-patch-comments = ["drop unused, benchmark-only criterion dev-dependen
 
 [tests]
 skip = [
-    "variant_iter::tests::test_variant_iter_array",
-    "variant_iter::tests::test_variant_str_iter_last",
-    "variant_iter::tests::test_variant_str_iter_nth",
-    "variant::Variant::array_iter_str",
     "structured_log",
 ]
+skip-exact = true
 comments = [
-    "skip tests that crash when built with Fedora rustc",
     "skip a test that only works when run in-tree",
 ]
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-25 10:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 10:37 [rpms/rust-glib] epel10: Backport upstreamed patch to fix UB in VariantStr::impl_get Fabio Valentini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox