Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: gdb-patches@sourceware.org
Cc: jimb@codesourcery.com
Subject: [PATCH] ax-gdb, null ptr guard
Date: Tue, 24 Jul 2007 20:31:00 -0000	[thread overview]
Message-ID: <8742.12.7.175.2.1185308489.squirrel@webmail.sonic.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

Coverity...


[-- Attachment #2: thisname.txt --]
[-- Type: text/plain, Size: 1175 bytes --]

2007-07-24  Michael Snyder  <msnyder@access-company.com>

	* ax-gdb.c (find_field): Guard against null ptr.

Index: ax-gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-gdb.c,v
retrieving revision 1.34
diff -p -r1.34 ax-gdb.c
*** ax-gdb.c	13 Jun 2007 17:11:09 -0000	1.34
--- ax-gdb.c	24 Jul 2007 20:18:36 -0000
*************** find_field (struct type *type, char *nam
*** 1172,1183 ****
      {
        char *this_name = TYPE_FIELD_NAME (type, i);
  
!       if (this_name && strcmp (name, this_name) == 0)
! 	return i;
  
!       if (this_name[0] == '\0')
! 	internal_error (__FILE__, __LINE__,
! 			_("find_field: anonymous unions not supported"));
      }
  
    error (_("Couldn't find member named `%s' in struct/union `%s'"),
--- 1172,1186 ----
      {
        char *this_name = TYPE_FIELD_NAME (type, i);
  
!       if (this_name)
! 	{
! 	  if (strcmp (name, this_name) == 0)
! 	    return i;
  
! 	  if (this_name[0] == '\0')
! 	    internal_error (__FILE__, __LINE__,
! 			    _("find_field: anonymous unions not supported"));
! 	}
      }
  
    error (_("Couldn't find member named `%s' in struct/union `%s'"),

             reply	other threads:[~2007-07-24 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 20:31 msnyder [this message]
2007-07-24 22:50 ` Jim Blandy
2007-07-25  0:27   ` msnyder

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=8742.12.7.175.2.1185308489.squirrel@webmail.sonic.net \
    --to=msnyder@sonic.net \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@codesourcery.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