From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45350 invoked by alias); 26 Oct 2015 10:00:06 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 45328 invoked by uid 89); 26 Oct 2015 10:00:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Oct 2015 10:00:04 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 0A139A80613; Mon, 26 Oct 2015 11:00:02 +0100 (CET) Date: Mon, 26 Oct 2015 10:36:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: mkshortcut (cygutils-1.4.14) free error Message-ID: <20151026100002.GA31990@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <1445135414.3384650.413058409.46BC94AD@webmail.messagingengine.com> <1445823930.241438.419951441.109BA262@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-10/txt/msg00446.txt.bz2 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1977 On Oct 26 03:57, Mark Geisert wrote: > Anthony Heading writes: > > I see the cygutils package has been orphaned, perhaps explaining the > > lack of response to the below.=20=20 > > A related question then is that the vanilla mkshortcut built from the > > latest source package does not > > seem to perfectly match the behaviour of the binary. Is there any way > > to review or reproduce how > > the binary package was built, or any other way to verify that the source > > and binaries do match? >=20 > Unfortunately I have no answers for your good questions above. But... >=20 > > On Sat, Oct 17, 2015, at 10:30 PM, Anthony Heading wrote: > > > Seems free() is being called on an adjusted pointer, causing general > > > misbehaviour. A minimal patch below. >=20 > [...sorry for deletions within the patch; trying to satisfy gmane...] > > > - char *buf_str, *tmp_str; > > > + char *buf_str, *tmp_str, *base_str; > [...] > > > buf_str =3D xstrndup (opts.target_arg, strlen(opts.target_arg)= ); > > > + base_str =3D buf_str; > > > tmp_str =3D buf_str; >=20 > ...if tmp_str is not modified after the above line, ... >=20 > > > tmp =3D strlen (buf_str) - 1; > > > while (strrchr (buf_str, '/') =3D=3D (buf_str + tmp)) > > > -504,7 +505,7 =20 > > > buf_str++; > > > } > > > link_name =3D xstrndup (tmp_str, strlen (tmp_str)); > > > - free (buf_str); > > > + free (base_str); >=20 > ...then "free(tmp_str);" should solve the original issue without having to > define a new variable base_str. I didn't look at the complete original > code, only the patch that you posted, but hopefully this points to a "more > minimal" fix if you agree it's solid. Ideally somebody takes a heart and takes over the package as maintainer :} Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWLfmhAAoJEPU2Bp2uRE+g7tYP/2GP7MldM1Tpd+vOzo3EacbQ GvxgiHunjSfutyieP35ToC7LloNPQLCwk0U8Y41/ikf5mIJ7z04aHmGD7lcvRaC/ B9JHlJKnx7zA+cWXSK/KsErA+OwAf0yUrecYeCLiYxMo5KhiKrlKaKIoCKmovCWs etgeEVQLx+NQTGMSmLfUnDCap8/RO4GimnL7Dr9K9BiTpBe75ka0TSXroWQ0Cx0o iaLCHwEcjSgswQ7cVX6WD5OqlegEHDQX25/aHMg2ULuo4zEi8YeENg+bKlKx6zFz hwyF1u21XGv3B236KoSnD1dDYcNZXm19R3beVrUWcTW6Bou7zpVH+9CIvpmDwRej 4BRXaQWV7OPGtSSad+B34ari7E2BWU7fC8PwrIDAneSBtdLbXJeFLLkw3IGVKS17 YnzREAoxLvducCU91X/Riwehe+vYzUUl9VmRaRrZTZcxr+Uk41yPdw56TNJXY/zB vaVdHo57kQxrG5QNyj4KBbaUnjyBxVDH2dmTuqy64U7iHa28KWhanZLWHnmEdAAu hFaoQQxAH7MTinj55remkAwDYnHWUfX9YisVVaDqTYlz4NXQjVtubFr2Vj5b3r/n ibgJQYvKIWNpmqZaxEWj55I9jZ2EgVZ8Go9IBAr7IAK1crfkpPS66DJ4uuFxRs/l xYDx25Z2M7dhkPvGXD0U =G9xu -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--