Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: msnyder@sonic.net
Cc: gdb-patches@sourceware.org, brobecker@adacore.com
Subject: Re: [PATCH] ada-lang.c, null pointer
Date: Sat, 11 Aug 2007 20:31:00 -0000	[thread overview]
Message-ID: <25376.12.7.175.2.1186864263.squirrel@webmail.sonic.net> (raw)
In-Reply-To: <8146.12.7.175.2.1186864158.squirrel@webmail.sonic.net>

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

> According to the first line of the function, name may be null.
> In which case, we'll crash on the next line.

Err, here's the patch...


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

2007-08-11  Michael Snyder  <msnyder@access-company.com>

	* ada-lang.c (field_alignment): Guard against NULL.

Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.100
diff -p -r1.100 ada-lang.c
*** ada-lang.c	6 Aug 2007 20:07:44 -0000	1.100
--- ada-lang.c	11 Aug 2007 20:25:00 -0000
*************** field_alignment (struct type *type, int 
*** 6119,6125 ****
    int len = (name == NULL) ? 0 : strlen (name);
    int align_offset;
  
!   if (!isdigit (name[len - 1]))
      return 1;
  
    if (isdigit (name[len - 2]))
--- 6119,6125 ----
    int len = (name == NULL) ? 0 : strlen (name);
    int align_offset;
  
!   if (name == NULL || !isdigit (name[len - 1]))
      return 1;
  
    if (isdigit (name[len - 2]))

  reply	other threads:[~2007-08-11 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-11 20:29 msnyder
2007-08-11 20:31 ` msnyder [this message]
2007-08-14  4:19   ` Joel Brobecker
2007-08-14  5:49     ` Michael Snyder
2007-08-14 20:21       ` Joel Brobecker

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=25376.12.7.175.2.1186864263.squirrel@webmail.sonic.net \
    --to=msnyder@sonic.net \
    --cc=brobecker@adacore.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