diff options
author | Guenter Roeck <linux@roeck-us.net> | 2017-05-08 18:56:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-08 20:15:12 -0400 |
commit | da5e108b0288d390dae40f51c09bbb30358bf7a7 (patch) | |
tree | 6275c878329439ee02c6fabb01846760737123a9 /lib/zlib_inflate | |
parent | f2ad37da805414e9385e7ca2961e1d0431df3799 (diff) |
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>
Diffstat (limited to 'lib/zlib_inflate')
-rw-r--r-- | lib/zlib_inflate/inftrees.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib_inflate/inftrees.c index 3fe6ce5b53e5..028943052926 100644 --- a/lib/zlib_inflate/inftrees.c +++ b/lib/zlib_inflate/inftrees.c | |||
@@ -109,7 +109,7 @@ int zlib_inflate_table(codetype type, unsigned short *lens, unsigned codes, | |||
109 | *bits = 1; | 109 | *bits = 1; |
110 | return 0; /* no symbols, but wait for decoding to report error */ | 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 | if (count[min] != 0) break; | 113 | if (count[min] != 0) break; |
114 | if (root < min) root = min; | 114 | if (root < min) root = min; |
115 | 115 | ||