diff options
author | George Wilson <george.wilson@delphix.com> | 2013-02-10 22:21:05 -0800 |
---|---|---|
committer | Christopher Siden <chris.siden@delphix.com> | 2013-02-10 22:21:05 -0800 |
commit | d5285cae913f4e01ffa0e6693a6d8ef1fbea30ba (patch) | |
tree | 204af0fe922145c182507a38bd9134150541b64a /usr/src/uts/common/fs/zfs/lzjb.c | |
parent | 7535ae1914017b0e648abd7a139aca709fa82be3 (diff) | |
download | illumos-joyent-d5285cae913f4e01ffa0e6693a6d8ef1fbea30ba.tar.gz |
3522 zfs module should not allow uninitialized variables
Reviewed by: Sebastien Roy <seb@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/fs/zfs/lzjb.c')
-rw-r--r-- | usr/src/uts/common/fs/zfs/lzjb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/zfs/lzjb.c b/usr/src/uts/common/fs/zfs/lzjb.c index ab3de51b72..a938fee7a3 100644 --- a/usr/src/uts/common/fs/zfs/lzjb.c +++ b/usr/src/uts/common/fs/zfs/lzjb.c @@ -37,6 +37,7 @@ */ #include <sys/types.h> +#include <sys/param.h> #define MATCH_BITS 6 #define MATCH_MIN 3 @@ -50,7 +51,8 @@ lzjb_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { uchar_t *src = s_start; uchar_t *dst = d_start; - uchar_t *cpy, *copymap; + uchar_t *cpy; + uchar_t *copymap = NULL; int copymask = 1 << (NBBY - 1); int mlen, offset, hash; uint16_t *hp; @@ -99,7 +101,8 @@ lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) uchar_t *src = s_start; uchar_t *dst = d_start; uchar_t *d_end = (uchar_t *)d_start + d_len; - uchar_t *cpy, copymap; + uchar_t *cpy; + uchar_t copymap = 0; int copymask = 1 << (NBBY - 1); while (dst < d_end) { |