[bug report] lib: update LZ4 compressor module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sven Schmidt,

This is a semi-automatic email about new static checker warnings.

The patch e355e356f87b: "lib: update LZ4 compressor module" from Jan 
25, 2017, leads to the following Smatch complaint:

lib/lz4/lz4_compress.c:890 lz4_compress()
	 warn: variable dereferenced before check 'dst_len' (see line 880)

lib/lz4/lz4_compress.c
   879		size_t *dst_len, void *wrkmem) {
   880		*dst_len = LZ4_compress_default(src, dst, (int)src_len,
                 ^^^^^^^
Dereference.

   881			(int)((size_t)dst_len), wrkmem);
   882	
   883		/*
   884		 * Prior lz4_compress will return -1 in case of error
   885		 * and 0 on success
   886		 * while new LZ4_compress_fast/default
   887		 * returns 0 in case of error
   888		 * and the output length on success
   889		 */
   890		if (!dst_len)
                     ^^^^^^^
Checked too late.  Can this test just be deleted?

   891			return -1;
   892		else

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux