diff options
Diffstat (limited to 'usr/src/grub')
| -rw-r--r-- | usr/src/grub/grub-0.97/stage2/zfs_lz4.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr/src/grub/grub-0.97/stage2/zfs_lz4.c b/usr/src/grub/grub-0.97/stage2/zfs_lz4.c index 42c03f9135..6d94111538 100644 --- a/usr/src/grub/grub-0.97/stage2/zfs_lz4.c +++ b/usr/src/grub/grub-0.97/stage2/zfs_lz4.c @@ -214,6 +214,9 @@ LZ4_uncompress_unknownOutputSize(const char *source, } /* copy literals */ cpy = op + length; + /* CORNER-CASE: cpy might overflow. */ + if (cpy < op) + goto _output_error; /* cpy was overflowed, bail! */ if ((cpy > oend - COPYLENGTH) || (ip + length > iend - COPYLENGTH)) { if (cpy > oend) |
