public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] sim: m32c/rl78/rx: fix command parsing
Date: Wed, 05 May 2021 13:13:52 -0600	[thread overview]
Message-ID: <877dkdq9hr.fsf@tromey.com> (raw)
In-Reply-To: <20210505190220.28848-1-vapier@gentoo.org> (Mike Frysinger via Gdb-patches's message of "Wed, 5 May 2021 15:02:20 -0400")

>>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:

Mike> Use buildargv to avoid writing to const memory and freeing invalid
Mike> pointers, and to avoid doing any string parsing ourselves.

Thank you.

Mike> +  char **argv = buildargv (cmd);
 
Mike> +      cmd = argv[0];
Mike> +      arg = argv[1];

I think this should also check that argv[0] and argv[1] != NULL somewhere.
Otherwise malformed commands like "monitor" or "monitor trace" may crash.

Tom

  reply	other threads:[~2021-05-05 19:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  3:04 [PATCH/committed] sim: rl78: clean up various warnings Mike Frysinger
2021-05-05 17:30 ` Tom Tromey
2021-05-05 18:52   ` Mike Frysinger
2021-05-05 19:05     ` Tom Tromey
2021-05-05 19:02   ` [PATCH] sim: m32c/rl78/rx: fix command parsing Mike Frysinger
2021-05-05 19:13     ` Tom Tromey [this message]
2021-05-05 23:03       ` [PATCH v2] " Mike Frysinger
2021-05-05 23:06       ` [PATCH v3] " Mike Frysinger

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=877dkdq9hr.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /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).