From owner-svn-src-all@FreeBSD.ORG Mon Feb 3 17:25:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E4C4906; Mon, 3 Feb 2014 17:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC281DE0; Mon, 3 Feb 2014 17:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s13HPb3M078759; Mon, 3 Feb 2014 17:25:37 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s13HPb4Z078758; Mon, 3 Feb 2014 17:25:37 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402031725.s13HPb4Z078758@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 3 Feb 2014 17:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261440 - head/sys/geom/uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 17:25:37 -0000 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;