summaryrefslogtreecommitdiff
path: root/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch')
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch b/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
new file mode 100644
index 000000000000..c308269c1b24
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
@@ -0,0 +1,27 @@
+The package app-crypt/mhash-0.9.9 as well as app-crypt/mhash-0.9.9-r1 are
+affected by a bug which causes a NULL ptr dereference in whirlpool/snefru
+digest-completion functionality.
+
+In this patch, whirlpool and snefru's code is updated to bail if 'digest' is
+NULL. The code portion aborted is only responsible for writing data to the
+digest, so this appears to be correct behavior.
+
+Patch already submitted upstream, but depending on speed, this may be faster to
+patch in a new patchset.
+
+Gentoo-Bug: 255131
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=255131
+Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=178666&action=view
+Signed-off-by: Thomas Harning <harningt@gmail.com>
+
+--- mhash-0.9.9/lib/snefru.c 2009-01-16 00:16:04.000000000 -0500
++++ mhash-0.9.9-new/lib/snefru.c 2009-01-16 00:16:21.000000000 -0500
+@@ -859,6 +859,8 @@
+ {
+ mutils_word32 i;
+
++ if(!digest) return;
++
+ for (i = 0; i < len; i++, digest += 4)
+ {
+ *(mutils_word32 *)digest = mutils_bend2sys32(ctx->hash[i]);