public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Fabio Valentini <decathorpe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-glib] epel10: Backport upstreamed patch to fix UB in VariantStr::impl_get
Date: Fri, 25 Sep 2026 10:37:09 GMT	[thread overview]
Message-ID: <179033262986.1.7769655332149916771.rpms-rust-glib-d2f944aebdd8@fedoraproject.org> (raw)

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",
 ]
 

                 reply	other threads:[~2026-09-25 10:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179033262986.1.7769655332149916771.rpms-rust-glib-d2f944aebdd8@fedoraproject.org \
    --to=decathorpe@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox