From owner-svn-src-all@FreeBSD.ORG Sat Jan 21 11:19:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8E0106564A; Sat, 21 Jan 2012 11:19:25 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id D41A18FC08; Sat, 21 Jan 2012 11:19:24 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BD64EAB2; Sat, 21 Jan 2012 12:19:21 +0100 (CET) Date: Sat, 21 Jan 2012 12:18:10 +0100 From: Pawel Jakub Dawidek To: Dag-Erling Smorgrav Message-ID: <20120121111809.GB1723@garage.freebsd.pl> References: <201201181513.q0IFDMb1045392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: <201201181513.q0IFDMb1045392@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230307 - in head: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 21 Jan 2012 11:19:25 -0000 --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 18, 2012 at 03:13:22PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Wed Jan 18 15:13:21 2012 > New Revision: 230307 > URL: http://svn.freebsd.org/changeset/base/230307 >=20 > Log: > Fix two issues related to the use of SIGINFO in fetch(1) to display > progress information. The first is that fetch_read() (used in the HTTP > code but not the FTP code) can enter an infinite loop if it has previou= sly > been interrupted by a signal. The second is that when it is interrupte= d, > fetch_read() will discard any data it may have read up to that point. > Luckily, both bugs are extremely timing-sensitive and therefore difficu= lt > to trigger. > =20 > PR: bin/153240 > Submitted by: Mark > MFC after: 3 weeks [...] > +static int > +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) > +{ > + char *tmp; > + > + if (conn->cache.size < nbytes) { > + tmp =3D realloc(conn->cache.buf, nbytes); > + if (tmp =3D=3D NULL) { > + errno =3D ENOMEM; realloc(3) on failures sets errno to ENOMEM for you already. > + conn->cache.len -=3D total; > + conn->cache.pos +=3D total; > + len -=3D total; > + buf+=3D total; Style nit (missing space before +=3D). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8anvEACgkQForvXbEpPzT5wACfYqA6AdeqJcQo0pkRIRWG+NQL m3AAoMucxtqJSBCQYSgRPlJZZWSGZnNj =cSPT -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh--