public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jerry James <loganjerry@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/nauty] f44: Add patch to fix undefined behavior
Date: Thu, 03 Sep 2026 13:58:21 GMT [thread overview]
Message-ID: <178844390151.1.9291609383152401743.rpms-nauty-2db73516bfa2@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/nauty
Branch : f44
Commit : 2db73516bfa293885b8ec9534204d13986b8c1c9
Author : Jerry James <loganjerry@gmail.com>
Date : 2026-09-03T07:58:05-06:00
Stats : +35/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/nauty/c/2db73516bfa293885b8ec9534204d13986b8c1c9?branch=f44
Log:
Add patch to fix undefined behavior
- Drop the -fwrapv flag
- Fix hardlinking countg and pickg
---
diff --git a/nauty-undefined-behavior.patch b/nauty-undefined-behavior.patch
new file mode 100644
index 0000000..4fe19a6
--- /dev/null
+++ b/nauty-undefined-behavior.patch
@@ -0,0 +1,31 @@
+--- nauty2_9_3/nausha.c.orig 2025-12-31 05:56:01.000000000 -0700
++++ nauty2_9_3/nausha.c 2026-09-02 12:37:44.905550503 -0600
+@@ -74,8 +74,8 @@ sha256_transform(SHA256_CTX *ctx, const
+ nsword32 a, b, c, d, e, f, g, h, i, j, t1, t2, m[64];
+
+ for (i = 0, j = 0; i < 16; ++i, j += 4)
+- m[i] = (data[j] << 24) | (data[j + 1] << 16)
+- | (data[j + 2] << 8) | (data[j + 3]);
++ m[i] = ((nsword32)data[j] << 24) | ((nsword32)data[j + 1] << 16)
++ | ((nsword32)data[j + 2] << 8) | ((nsword32)data[j + 3]);
+ for ( ; i < 64; ++i)
+ m[i] = SIG1(m[i - 2]) + m[i - 7] + SIG0(m[i - 15]) + m[i - 16];
+
+--- nauty2_9_3/watercluster2.c.orig 2026-09-02 12:32:28.566922114 -0600
++++ nauty2_9_3/watercluster2.c 2026-09-02 13:47:51.245804016 -0600
+@@ -3130,13 +3130,13 @@ int i,start,end, problem, sum, maxsum;
+ int getexpensivequality(graph x,graph y)
+ {
+ int j;
+-int qual=0;
++unsigned int qual=0;
+
+ FORALLELEMENTS(x,j) qual+=(saturated[j]<<4)-indeg_free[j];
+ qual = qual<<6;
+ FORALLELEMENTS(y,j) qual+=(saturated[j]<<4)-indeg_free[j];
+
+- return qual;
++ return (int)qual;
+ }
+
+ int is_canonical_edge(BOOG list[],int last_positie)
diff --git a/nauty.spec b/nauty.spec
index 8cc5020..392bdc8 100644
--- a/nauty.spec
+++ b/nauty.spec
@@ -30,6 +30,8 @@ Patch: %{name}-popcnt.patch
Patch: %{name}-unbundle-cliquer.patch
# Fix uninitialized variable warnings
Patch: %{name}-uninitialized.patch
+# Avoid undefined behavior due to left shifts of signed values
+Patch: %{name}-undefined-behavior.patch
BuildRequires: gcc
BuildRequires: gmp-devel
@@ -94,7 +96,7 @@ if [ '%{_lib}' != 'lib' ]; then
fi
%build
-export CFLAGS='%{build_cflags} -fwrapv -I%{_includedir}/cliquer'
+export CFLAGS='%{build_cflags} -I%{_includedir}/cliquer'
export LIBS='-lz-ng'
%configure \
--enable-ansi \
@@ -129,7 +131,7 @@ done
# Link identical executables
rm %{buildroot}%{_bindir}/pickg
-ln countg %{buildroot}%{_bindir}/pickg
+ln %{buildroot}%{_bindir}/countg %{buildroot}%{_bindir}/pickg
# Move the headers
mkdir -p %{buildroot}%{_includedir}/nauty
reply other threads:[~2026-09-03 13:58 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=178844390151.1.9291609383152401743.rpms-nauty-2db73516bfa2@fedoraproject.org \
--to=loganjerry@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