diff options
author | Alexis Ballier <aballier@gentoo.org> | 2009-05-12 10:29:23 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2009-05-12 10:29:23 +0000 |
commit | 4c4ffebce16ad33deb30f56db31097e3f4f4c6ba (patch) | |
tree | e495b5a63b735e970b94a93931b9f0edaaa21792 /sys-freebsd/freebsd-lib/files | |
parent | List net-wireless/bluez first in ||( a b ) dependency w.r.t. bug 269519. (diff) | |
download | gentoo-2-4c4ffebce16ad33deb30f56db31097e3f4f4c6ba.tar.gz gentoo-2-4c4ffebce16ad33deb30f56db31097e3f4f4c6ba.tar.bz2 gentoo-2-4c4ffebce16ad33deb30f56db31097e3f4f4c6ba.zip |
add fix for http://security.freebsd.org/advisories/FreeBSD-SA-09:07.libc.asc
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'sys-freebsd/freebsd-lib/files')
-rw-r--r-- | sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-db.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-db.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-db.patch new file mode 100644 index 000000000000..42b14e8c1475 --- /dev/null +++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-db.patch @@ -0,0 +1,69 @@ +http://security.freebsd.org/advisories/FreeBSD-SA-09:07.libc.asc + + + +Index: lib/libc/db/btree/bt_split.c +=================================================================== +--- lib/libc/db/btree/bt_split.c ++++ lib/libc/db/btree/bt_split.c +@@ -372,7 +372,7 @@ + } + + /* Put the new left page for the split into place. */ +- if ((l = (PAGE *)malloc(t->bt_psize)) == NULL) { ++ if ((l = (PAGE *)calloc(1, t->bt_psize)) == NULL) { + mpool_put(t->bt_mp, r, 0); + return (NULL); + } +Index: lib/libc/db/hash/hash_buf.c +=================================================================== +--- lib/libc/db/hash/hash_buf.c ++++ lib/libc/db/hash/hash_buf.c +@@ -57,6 +57,7 @@ + #include <stddef.h> + #include <stdio.h> + #include <stdlib.h> ++#include <string.h> + + #ifdef DEBUG + #include <assert.h> +@@ -169,12 +170,12 @@ + */ + if (hashp->nbufs || (bp->flags & BUF_PIN)) { + /* Allocate a new one */ +- if ((bp = (BUFHEAD *)malloc(sizeof(BUFHEAD))) == NULL) ++ if ((bp = (BUFHEAD *)calloc(1, sizeof(BUFHEAD))) == NULL) + return (NULL); + #ifdef PURIFY + memset(bp, 0xff, sizeof(BUFHEAD)); + #endif +- if ((bp->page = (char *)malloc(hashp->BSIZE)) == NULL) { ++ if ((bp->page = (char *)calloc(1, hashp->BSIZE)) == NULL) { + free(bp); + return (NULL); + } +@@ -319,8 +314,10 @@ + } + /* Check if we are freeing stuff */ + if (do_free) { +- if (bp->page) ++ if (bp->page) { ++ (void)memset(bp->page, 0, hashp->BSIZE); + free(bp->page); ++ } + BUF_REMOVE(bp); + free(bp); + bp = LRU; +Index: lib/libc/db/mpool/mpool.c +=================================================================== +--- lib/libc/db/mpool/mpool.c ++++ lib/libc/db/mpool/mpool.c +@@ -332,7 +332,7 @@ + return (bp); + } + +-new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL) ++new: if ((bp = (BKT *)calloc(1, sizeof(BKT) + mp->pagesize)) == NULL) + return (NULL); + #ifdef STATISTICS + ++mp->pagealloc; |