Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/zlib_inflate/inftrees.c: fix potential buffer overflow

smatch says:

WARNING: please, no spaces at the start of a line
#30: FILE: lib/zlib_inflate/inftrees.c:112:
+ for (min = 1; min < MAXBITS; min++)$

total: 0 errors, 1 warnings, 8 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

./patches/zlib-inflate-fix-potential-buffer-overflow.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Guenter Roeck and committed by
Linus Torvalds
da5e108b f2ad37da

+1 -1
+1 -1
lib/zlib_inflate/inftrees.c
··· 109 109 *bits = 1; 110 110 return 0; /* no symbols, but wait for decoding to report error */ 111 111 } 112 - for (min = 1; min <= MAXBITS; min++) 112 + for (min = 1; min < MAXBITS; min++) 113 113 if (count[min] != 0) break; 114 114 if (root < min) root = min; 115 115