From 3f2f1419a2b63f611d00b3ea65c9fb7ac9f91af2 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Tue, 28 Apr 2026 20:56:04 +0200 Subject: [PATCH] Apply patch: ncpfs-hg-commit-453.patch --- .../ncpfs-2.2.6-r6/ncpfs-hg-commit-453.patch | 29 +++++++++++++++++++ lib/ndslib.c | 3 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .patches/ncpfs-2.2.6-r6/ncpfs-hg-commit-453.patch diff --git a/.patches/ncpfs-2.2.6-r6/ncpfs-hg-commit-453.patch b/.patches/ncpfs-2.2.6-r6/ncpfs-hg-commit-453.patch new file mode 100644 index 0000000..b2d29dd --- /dev/null +++ b/.patches/ncpfs-2.2.6-r6/ncpfs-hg-commit-453.patch @@ -0,0 +1,29 @@ +changeset: 453:329b32c7d8a6 +user: Petr Vandrovec +date: Thu Apr 13 19:59:28 2006 +0200 +files: lib/ndslib.c +description: +Fix nds_beginauth2 on Fedora + +nds_beginauth2 was aliging pointer to be multiple of 4 bytes, instead of +aligning offset from start of buffer to the pointer to be multiple of 4 +bytes. This was not problem before, as buffer itself was 4 byte aligned, +but Fedora's compiler has options which can misalign it... + +See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186683. + + +diff -r b2ec015c1689 -r 329b32c7d8a6 lib/ndslib.c +--- a/lib/ndslib.c Sun Oct 16 04:14:27 2005 +0200 ++++ b/lib/ndslib.c Thu Apr 13 19:59:28 2006 +0200 +@@ -1026,7 +1026,8 @@ static NWDSCCODE nds_beginauth2( + goto err_exit; + } + copyfill(n_temp, n1, p, n3a); +- p = (void*)(((unsigned long)k1end + 3) & ~3); ++ /* align p to the first 4 byte boundary beyond k1end */ ++ p = k1end + ((p - k1end) & 3); + err = modexpkey(s_key, n_temp, n_temp, n1); + if (err) { + ISRPrint("modexpkey failed\n"); + diff --git a/lib/ndslib.c b/lib/ndslib.c index 1e094b9..f1c1dc9 100644 --- a/lib/ndslib.c +++ b/lib/ndslib.c @@ -1026,7 +1026,8 @@ static NWDSCCODE nds_beginauth2( goto err_exit; } copyfill(n_temp, n1, p, n3a); - p = (void*)(((unsigned long)k1end + 3) & ~3); + /* align p to the first 4 byte boundary beyond k1end */ + p = k1end + ((p - k1end) & 3); err = modexpkey(s_key, n_temp, n_temp, n1); if (err) { ISRPrint("modexpkey failed\n");