You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch

28 lines
1016 B

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 memory to be leaked during
mhash_restore_state_mem.
In this function/patch, ret->state is allocated towards the beginning and later
on replaced with a new allocated area without freeing the old. The patch fixes
it.
Patch already submitted upstream, but depending on speed, this may be faster to
patch in a new patchset.
Gentoo-Bug: 255006
Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=255006
Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=178560
Signed-off-by: Thomas Harning <harningt@gmail.com>
--- mhash-0.9.9/lib/mhash.c 2007-02-21 01:18:46.000000000 -0500
+++ mhash-0.9.9-new/lib/mhash.c 2009-01-15 01:57:53.000000000 -0500
@@ -719,6 +719,8 @@
mutils_memcpy( &ret->state_size, &mem[pos], sizeof(ret->state_size));
pos += sizeof( ret->state_size);
+ if (ret->state)
+ mutils_free(ret->state);
ret->state = mutils_malloc(ret->state_size);
if (ret->state==NULL)
goto freeall;