Skip to content

Commit e6a118e

Browse files
committed
moduzlib: Update to uzlib v1.2.
Actually manage size of the output buffer.
1 parent 2f8c409 commit e6a118e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

extmod/uzlib/tinflate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt)
337337
}
338338

339339
*d->dest++ = sym;
340+
d->destRemaining--;
340341

341342
} else {
342343

@@ -366,6 +367,7 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt)
366367
}
367368

368369
d->dest += length;
370+
d->destRemaining -= length;
369371
}
370372
}
371373
}
@@ -397,6 +399,7 @@ static int tinf_inflate_uncompressed_block(TINF_DATA *d)
397399

398400
/* copy block */
399401
for (i = length; i; --i) *d->dest++ = *d->source++;
402+
d->destRemaining -= length;
400403

401404
/* make sure we start next block on a byte boundary */
402405
d->bitcount = 0;

0 commit comments

Comments
 (0)