Date: Mon, 3 Feb 2014 17:25:37 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261440 - head/sys/geom/uncompress Message-ID: <201402031725.s13HPb4Z078758@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Mon Feb 3 17:25:36 2014 New Revision: 261440 URL: http://svnweb.freebsd.org/changeset/base/261440 Log: 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) Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 17:21:36 2014 (r261439) +++ head/sys/geom/uncompress/g_uncompress.c Mon Feb 3 17:25:36 2014 (r261440) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402031725.s13HPb4Z078758>