From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129369 invoked by alias); 26 Oct 2015 01:45:36 -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 129354 invoked by uid 89); 26 Oct 2015 01:45:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: out3-smtp.messagingengine.com Received: from out3-smtp.messagingengine.com (HELO out3-smtp.messagingengine.com) (66.111.4.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 26 Oct 2015 01:45:33 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DC44920A5F for ; Sun, 25 Oct 2015 21:45:30 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute5.internal (MEProxy); Sun, 25 Oct 2015 21:45:30 -0400 Received: by web5.nyi.internal (Postfix, from userid 99) id AD171AC3A22; Sun, 25 Oct 2015 21:45:30 -0400 (EDT) Message-Id: <1445823930.241438.419951441.109BA262@webmail.messagingengine.com> From: Anthony Heading To: cygwin@cygwin.com MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain In-Reply-To: <1445135414.3384650.413058409.46BC94AD@webmail.messagingengine.com> References: <1445135414.3384650.413058409.46BC94AD@webmail.messagingengine.com> Subject: Re: mkshortcut (cygutils-1.4.14) free error Date: Mon, 26 Oct 2015 10:01:00 -0000 X-SW-Source: 2015-10/txt/msg00444.txt.bz2 Hi, I see the cygutils package has been orphaned, perhaps explaining the lack of response to the below. 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? Thanks Anthony 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. > > Anthony > > > --- src/mkshortcut/mkshortcut.c.Orig 2015-10-17 21:57:08.000000000 > -0400 > +++ src/mkshortcut/mkshortcut.c 2015-10-17 22:16:41.269357400 -0400 > @@ -412,7 +412,7 @@ > char* exe_name = NULL; > char* dir_name = NULL; > char* desc = NULL; > - char *buf_str, *tmp_str; > + char *buf_str, *tmp_str, *base_str; > int tmp; > > /* For OLE interface */ > @@ -489,6 +489,7 @@ > { > /* Strip trailing /'s if any */ > buf_str = xstrndup (opts.target_arg, strlen(opts.target_arg)); > + base_str = buf_str; > tmp_str = buf_str; > tmp = strlen (buf_str) - 1; > while (strrchr (buf_str, '/') == (buf_str + tmp)) > @@ -504,7 +505,7 @@ > buf_str++; > } > link_name = xstrndup (tmp_str, strlen (tmp_str)); > - free (buf_str); > + free (base_str); > } > /* User specified a name, so check it and convert */ > else > > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple