mirror of
https://github.com/ipxe/ipxe
synced 2025-12-16 01:21:10 +03:00
[deflate] Fix literal data length calculation
Fix incorrect calculation used to determine length of data to be copied within a literal data block, and add a test case to prevent this bug from going undetected in future. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -609,7 +609,7 @@ int deflate_inflate ( struct deflate *deflate,
|
||||
/* Calculate available amount of literal data */
|
||||
in_remaining = ( in->len - in->offset );
|
||||
len = deflate->remaining;
|
||||
if ( len < in_remaining )
|
||||
if ( len > in_remaining )
|
||||
len = in_remaining;
|
||||
|
||||
/* Copy data to output buffer */
|
||||
|
||||
Reference in New Issue
Block a user