Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Ulrich Weigand" <uweigand@de.ibm.com>, binutils@sourceware.org
Subject: Re: [rfc][1/3] Remote core file generation: BFD support
Date: Wed, 09 Nov 2011 16:00:00 -0000	[thread overview]
Message-ID: <201111091600.30812.pedro@codesourcery.com> (raw)
In-Reply-To: <201110211856.p9LIu92B012443@d06av02.portsmouth.uk.ibm.com>

On Friday 21 October 2011 19:56:09, Ulrich Weigand wrote:

> Index: bfd/elf32-arm.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-arm.c,v
> retrieving revision 1.278
> diff -u -p -r1.278 elf32-arm.c
> --- bfd/elf32-arm.c	19 Oct 2011 07:17:13 -0000	1.278
> +++ bfd/elf32-arm.c	21 Oct 2011 16:49:54 -0000
> @@ -1986,6 +1986,55 @@ elf32_arm_nabi_grok_psinfo (bfd *abfd, E
>    return TRUE;
>  }
>  
> +static char *
> +elf32_arm_nabi_write_core_note (bfd *abfd, char *buf, int *bufsiz,
> +				int note_type, ...)
> +{
> +  switch (note_type)
> +    {
> +    default:
> +      return NULL;
> +
> +    case NT_PRPSINFO:
> +      {
> +	char data[124];
> +	va_list ap;
> +
> +	va_start (ap, note_type);
> +	memset (data, 0, 28);
> +	strncpy (data + 28, va_arg (ap, const char *), 16);
> +	strncpy (data + 44, va_arg (ap, const char *), 80);

The `data' buffer should be zero initialized, to avoid
leaving garbage on the core, when the passed in fname and
psargs are less than 16 and 80 bytes long respectively.
It's true the caller does that itself today, but
your patch 2 (rightly) makes it not do so anymore.

-- 
Pedro Alves


  parent reply	other threads:[~2011-11-09 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 18:57 Ulrich Weigand
2011-10-21 20:37 ` Mark Kettenis
2011-10-21 20:58   ` Ulrich Weigand
2011-11-09 16:00 ` Pedro Alves [this message]
2011-11-09 18:18   ` Ulrich Weigand
2012-01-16 23:23     ` Alan Modra

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=201111091600.30812.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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