Update to version 0.3.9; Fixes RHBZ#2312357

epel10 imports/epel10/rust-arrayref-0.3.9-1.el10
Fabio Valentini 5 months ago
parent edc4b10da2
commit 33c5407d40
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

1
.gitignore vendored

@ -3,3 +3,4 @@
/arrayref-0.3.6.crate /arrayref-0.3.6.crate
/arrayref-0.3.7.crate /arrayref-0.3.7.crate
/arrayref-0.3.8.crate /arrayref-0.3.8.crate
/arrayref-0.3.9.crate

@ -1,54 +0,0 @@
From af5a9154bde9eef7475d1f622bae8851333ad336 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Tue, 3 Sep 2024 10:11:29 -0400
Subject: [PATCH] Fix bounds math issues in tests revealed by quickcheck v1
Some tests relied on unsigned arithmetic that could wrap around, and
quickcheck 1.0 was able to reveal the problem. All of the issues were in
the tests rather than in the implementation.
Fixes #22. Fixes compatibility with quickcheck v1.
---
src/lib.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
index 7b6d4c0..1746f69 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -339,7 +339,7 @@ mod test {
#[test]
fn check_array_ref_5() {
fn f(data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
- if data.len() < offset + 5 {
+ if data.len() < 5 || data.len() - 5 < offset {
return quickcheck::TestResult::discard();
}
let out = array_ref!(data, offset, 5);
@@ -351,7 +351,7 @@ mod test {
#[test]
fn check_array_ref_out_of_bounds_5() {
fn f(data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
- if data.len() >= offset + 5 {
+ if data.len() >= 5 && data.len() - 5 >= offset {
return quickcheck::TestResult::discard();
}
quickcheck::TestResult::must_fail(move || {
@@ -364,7 +364,7 @@ mod test {
#[test]
fn check_array_mut_ref_7() {
fn f(mut data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
- if data.len() < offset + 7 {
+ if data.len() < 7 || data.len() - 7 < offset {
return quickcheck::TestResult::discard();
}
let out = array_mut_ref!(data, offset, 7);
@@ -377,7 +377,7 @@ mod test {
#[test]
fn check_array_mut_ref_out_of_bounds_32() {
fn f(mut data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
- if data.len() >= offset + 32 {
+ if data.len() >= 32 && data.len() - 32 >= offset {
return quickcheck::TestResult::discard();
}
quickcheck::TestResult::must_fail(move || {

@ -1,8 +0,0 @@
--- arrayref-0.3.8/Cargo.toml 1970-01-01T00:00:01+00:00
+++ arrayref-0.3.8/Cargo.toml 2024-09-03T14:21:24.860504+00:00
@@ -20,4 +20,4 @@
repository = "https://github.com/droundy/arrayref"
[dev-dependencies.quickcheck]
-version = "0.6"
+version = "1.0"

@ -5,23 +5,13 @@
%global crate arrayref %global crate arrayref
Name: rust-arrayref Name: rust-arrayref
Version: 0.3.8 Version: 0.3.9
Release: %autorelease Release: %autorelease
Summary: Macros to take array references of slices Summary: Macros to take array references of slices
License: BSD-2-Clause License: BSD-2-Clause
URL: https://crates.io/crates/arrayref URL: https://crates.io/crates/arrayref
Source: %{crates_source} Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * Update dev-dependency on quickcheck from 0.6 to 1.0
Patch: arrayref-fix-metadata.diff
# Fix bounds math issues in tests revealed by quickcheck v1
# https://github.com/droundy/arrayref/pull/28/commits/af5a9154bde9eef7475d1f622bae8851333ad336
# Fixes:
# test::check_array_ref_5 and test::check_array_mut_ref_7 fail with
# quickcheck@1.0.3
# https://github.com/droundy/arrayref/issues/22
Patch: https://github.com/droundy/arrayref/pull/28/commits/af5a9154bde9eef7475d1f622bae8851333ad336.patch
BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-rpm-macros >= 24

@ -1 +1 @@
SHA512 (arrayref-0.3.8.crate) = 27a1b5688327a45358cc62df868835e7da7276c73e853130c41c9f6d9f95822780f159c6e7d1fa10848ba30fed8e173a1d8949630f18a828c3009de342be21dc SHA512 (arrayref-0.3.9.crate) = f97e33e7fd65a8e908c21ab918350f71f12d49783162b90c5618660217b36516c39750b292a1248125f12429e4e00af9ff20c3846be81175946b8541d96ee606

Loading…
Cancel
Save