From: Anthony Heading <ajrh@ajrh.net>
To: cygwin@cygwin.com
Subject: Re: mkshortcut (cygutils-1.4.14) free error
Date: Mon, 26 Oct 2015 10:01:00 -0000 [thread overview]
Message-ID: <1445823930.241438.419951441.109BA262@webmail.messagingengine.com> (raw)
In-Reply-To: <1445135414.3384650.413058409.46BC94AD@webmail.messagingengine.com>
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
next prev parent reply other threads:[~2015-10-26 1:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-18 2:30 Anthony Heading
2015-10-26 10:01 ` Anthony Heading [this message]
2015-10-26 10:08 ` Mark Geisert
2015-10-26 10:36 ` Corinna Vinschen
2015-10-27 5:29 ` Anthony Heading
2015-10-26 16:03 ` Ken Brown
2015-10-27 0:11 ` Mark Geisert
2015-10-27 8:46 ` Anthony Heading
2015-10-27 9:30 ` Mark Geisert
2015-10-28 4:49 ` Anthony Heading
2015-10-28 9:15 ` Mark Geisert
2015-10-28 13:05 ` Corinna Vinschen
2015-10-28 14:49 ` Mark Geisert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445823930.241438.419951441.109BA262@webmail.messagingengine.com \
--to=ajrh@ajrh.net \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).