From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66649 invoked by alias); 18 Oct 2015 02:30:29 -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 66580 invoked by uid 89); 18 Oct 2015 02:30:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: out4-smtp.messagingengine.com Received: from out4-smtp.messagingengine.com (HELO out4-smtp.messagingengine.com) (66.111.4.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 18 Oct 2015 02:30:16 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C03C5201A3 for ; Sat, 17 Oct 2015 22:30:14 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute2.internal (MEProxy); Sat, 17 Oct 2015 22:30:14 -0400 Received: by web5.nyi.internal (Postfix, from userid 99) id 648E8A773FC; Sat, 17 Oct 2015 22:30:14 -0400 (EDT) Message-Id: <1445135414.3384650.413058409.46BC94AD@webmail.messagingengine.com> From: Anthony Heading To: cygwin@cygwin.com MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain Subject: mkshortcut (cygutils-1.4.14) free error Date: Sun, 18 Oct 2015 02:30:00 -0000 X-SW-Source: 2015-10/txt/msg00270.txt.bz2 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