Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb] Fix heap-buffer-overflow in args_complete_p
Date: Mon, 05 Jan 2026 09:38:59 -0700	[thread overview]
Message-ID: <87jyxwxbdo.fsf@tromey.com> (raw)
In-Reply-To: <20260103145559.2722584-1-tdevries@suse.de> (Tom de Vries's message of "Sat, 3 Jan 2026 15:55:59 +0100")

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> +  auto at = [&] (const char *s)
Tom> +    {
Tom> +      return s > end ? '\0' : *s;
Tom> +    };

I think it would better to avoid stepping off the end at the points
where the pointer is incremented.

Tom> +  while (at (input) != '\0')

Like this could be

   for (input = skip_spaces (input); *input != '\0'; input = skip_spaces (input))

and then there's like one or two spots to check in the loop.

Tom

  reply	other threads:[~2026-01-05 16:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-03 14:55 Tom de Vries
2026-01-05 16:38 ` Tom Tromey [this message]
2026-01-06 14:51   ` Tom de Vries
2026-01-05 19:57 ` Andrew Burgess
2026-01-05 20:02   ` Andrew Burgess
2026-01-05 20:09   ` Tom Tromey
2026-01-06  8:47   ` Tom de Vries
2026-01-06  9:29     ` Tom de Vries
2026-01-06 14:53     ` Tom de Vries
2026-01-07 10:46     ` Andrew Burgess
2026-01-07 11:21       ` Tom de Vries
2026-01-07 15:01         ` Andrew Burgess
2026-01-07 18:13           ` Tom Tromey
2026-01-12 11:42             ` Andrew Burgess

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=87jyxwxbdo.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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