We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e7be9d commit 741b23aCopy full SHA for 741b23a
fs/btrfs/lzo.c
@@ -380,6 +380,17 @@ int lzo_decompress_bio(struct list_head *ws, struct compressed_bio *cb)
380
kunmap(cur_page);
381
cur_in += LZO_LEN;
382
383
+ if (seg_len > lzo1x_worst_compress(PAGE_SIZE)) {
384
+ /*
385
+ * seg_len shouldn't be larger than we have allocated
386
+ * for workspace->cbuf
387
+ */
388
+ btrfs_err(fs_info, "unexpectedly large lzo segment len %u",
389
+ seg_len);
390
+ ret = -EIO;
391
+ goto out;
392
+ }
393
+
394
/* Copy the compressed segment payload into workspace */
395
copy_compressed_segment(cb, workspace->cbuf, seg_len, &cur_in);
396
0 commit comments