From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH v2] Cygwin: spawn: Fix segfalt when too many command line args are specified.
Date: Mon, 28 Aug 2023 21:51:34 +0900 [thread overview]
Message-ID: <20230828215134.74cc810cd41daea1a3e21cf4@nifty.ne.jp> (raw)
In-Reply-To: <ZOx9j/YRr3UX88wV@calimero.vinschen.de>
On Mon, 28 Aug 2023 12:57:19 +0200
Corinna Vinschen wrote:
> - char *newargv[__argc + 1];
> - char **nav = newargv;
> - char **oav = __argv;
> - while ((*nav++ = *oav++) != NULL)
> - continue;
> + char **newargv = (char **) malloc ((__argc + 1) * sizeof (char **));
> + memcpy (newargv, __argv, (__argc + 1) * sizeof (char **));
> /* Handle any signals which may have arrived */
> sig_dispatch_pending (false);
> _my_tls.call_signal_handler ();
Shouldn't this be sizeof (char *), not sizeof (char **)?
--
Takashi Yano <takashi.yano@nifty.ne.jp>
prev parent reply other threads:[~2023-08-28 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 9:46 Takashi Yano
2023-08-28 10:57 ` Corinna Vinschen
2023-08-28 11:09 ` Corinna Vinschen
2023-08-28 11:18 ` Corinna Vinschen
2023-08-28 12:14 ` Takashi Yano
2023-08-28 12:09 ` Takashi Yano
2023-08-28 12:20 ` Takashi Yano
2023-08-28 12:27 ` Takashi Yano
2023-08-28 13:23 ` Takashi Yano
2023-08-28 12:51 ` Takashi Yano [this message]
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=20230828215134.74cc810cd41daea1a3e21cf4@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-patches@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).