Skip to content

Commit

Permalink
lib/zlib_inflate/inftrees.c: fix potential buffer overflow
Browse files Browse the repository at this point in the history
smatch says:

WARNING: please, no spaces at the start of a line
linux-sunxi#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>
  • Loading branch information
groeck authored and sfrothwell committed May 4, 2017
1 parent 9480773 commit e3474ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zlib_inflate/inftrees.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int zlib_inflate_table(codetype type, unsigned short *lens, unsigned codes,
*bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min <= MAXBITS; min++)
for (min = 1; min < MAXBITS; min++)
if (count[min] != 0) break;
if (root < min) root = min;

Expand Down

0 comments on commit e3474ba

Please sign in to comment.