History

Merge tag 'compress-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull compress bugfix from Greg KH: "Here is another lz4 bugfix for 3.16-rc3 that resolves a reported issue with that compression algorithm" * tag 'compress-3.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: lz4: fix another possible overrun

Linus Torvalds committed 12 years ago

Commit 8dd68eb2 parents 772205d 4148c1f1 file · +3 −1Browse files

Unified · Split

lib/lz4/lz4_decompress.c+3−1
@@ -108,6 +108,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize) · 107 unmodified lines
108108 if (length == ML_MASK) {
109109 for (; *ip == 255; length += 255)
110110 ip++;
111+ if (unlikely(length > (size_t)(length + *ip)))
112+ goto _output_error;
111113 length += *ip++;
112114 }
113115
@@ -157,7 +159,7 @@ static int lz4_uncompress(const char *source, char *dest, int osize) · 43 unmodified lines
157159
158160 /* write overflow error detected */
159161 _output_error:
160− return (int) (-(((char *)ip) - source));
162+ return -1;
161163 }
162164
163165 static int lz4_uncompress_unknownoutputsize(const char *source, char *dest,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t