diff options
Diffstat (limited to 'src/gunzip.c')
-rw-r--r-- | src/gunzip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gunzip.c b/src/gunzip.c index 1d2881c..010d45e 100644 --- a/src/gunzip.c +++ b/src/gunzip.c @@ -49,12 +49,16 @@ static size_t gz_read(void *stream, void *ptr, size_t size) while (gis->zs.avail_out != 0 && gis->z_err == Z_OK) { if (gis->zs.avail_in == 0) { + apk_blob_t blob; + if (gis->cb != NULL && gis->mdblock != NULL) { /* Digest the inflated bytes */ EVP_DigestUpdate(&gis->mdctx, gis->mdblock, (void *)gis->zs.next_in - gis->mdblock); } - gis->zs.avail_in = gis->bs->read(gis->bs, &gis->mdblock); + blob = gis->bs->read(gis->bs, APK_BLOB_NULL); + gis->mdblock = blob.ptr; + gis->zs.avail_in = blob.len; gis->zs.next_in = (void *) gis->mdblock; if (gis->zs.avail_in < 0) { gis->z_err = Z_DATA_ERROR; |