From: Ian Lance Taylor <iant@google.com>
To: gkeating@apple.com (Geoffrey Keating)
Cc: dj@redhat.com, ian@airs.com, gcc-patches@gcc.gnu.org,
binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: fix end-of-string overrun problems in C++ demangler
Date: Wed, 20 Dec 2006 23:57:00 -0000 [thread overview]
Message-ID: <m3tzzq3yx8.fsf@localhost.localdomain> (raw)
In-Reply-To: <20061220223511.F04CE5771424@geoffk5.apple.com>
gkeating@apple.com (Geoffrey Keating) writes:
> 2006-12-20 Geoffrey Keating <geoffk@apple.com>
>
> * cp-demangle.h: Add comment explaining what to do to avoid
> overrunning string.
> (d_check_char): New.
> (d_next_char): Don't advance past trailing '\0'.
> * cp-demangle.c (cplus_demangle_mangled_name): Use d_check_char.
> (d_nested_name): Likewise.
> (d_special_name): Likewise.
> (d_call_offset): Likewise.
> (d_function_type): Likewise.
> (d_array_type): Likewise.
> (d_pointer_to_member_type): Likewise.
> (d_template_param): Likewise.
> (d_template_args): Likewise.
> (d_template_arg): Likewise.
> (d_expr_primary): Likewise.
> (d_local_name): Likewise.
> (d_substitution): Likewise.
> (d_ctor_dtor_name): Use d_advance rather than d_next_char.
> * testsuite/test-demangle.c: Include sys/mman.h.
> (MAP_ANONYMOUS): Define.
> (protect_end): New.
> (main): Use protect_end.
> * testsuite/demangle-expected: Add testcases for overrunning
> the end of the string.
Looks good to me. Thanks for cleaning this up.
Ian
prev parent reply other threads:[~2006-12-20 23:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-20 22:36 Geoffrey Keating
2006-12-20 23:57 ` Ian Lance Taylor [this message]
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=m3tzzq3yx8.fsf@localhost.localdomain \
--to=iant@google.com \
--cc=binutils@sourceware.org \
--cc=dj@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=gkeating@apple.com \
--cc=ian@airs.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