summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2014-02-03 17:25:36 +0000
committerloos <loos@FreeBSD.org>2014-02-03 17:25:36 +0000
commitdf1c99a134c5ddf9e4abae3399d9faf16bf2696c (patch)
treed5681db79b4d9317196c4a46c7eab338f26e2dd0 /sys/geom
parentdc526432103aa8083313d8e66f083ffb0922c07b (diff)
downloadFreeBSD-src-df1c99a134c5ddf9e4abae3399d9faf16bf2696c.zip
FreeBSD-src-df1c99a134c5ddf9e4abae3399d9faf16bf2696c.tar.gz
Fix a logic error. Because of this inflateReset() wasn't being called and
the output buffer wasn't being cleared between the inflate() calls, producing zeroed output after the first inflate() call. This fixes the read of mkuzip(8) images with geom_uncompress(4). Reviewed by: ray Approved by: adrian (mentor)
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/uncompress/g_uncompress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/uncompress/g_uncompress.c b/sys/geom/uncompress/g_uncompress.c
index ab980bc..60068e6 100644
--- a/sys/geom/uncompress/g_uncompress.c
+++ b/sys/geom/uncompress/g_uncompress.c
@@ -264,7 +264,7 @@ g_uncompress_done(struct bio *bp)
err = (inflate(sc->zs, Z_FINISH) != Z_STREAM_END) ?
1 : 0;
- if ((err) && (inflateReset(sc->zs) != Z_OK))
+ if ((err) || (inflateReset(sc->zs) != Z_OK))
printf("%s: UZIP decoder reset failed\n",
gp->name);
break;
OpenPOWER on IntegriCloud