This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][Bug cli/14011] New: GDB uses strcpy() with undefined behaviour,causing bug in CLI cd_command().
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Fredrik Hederstierna <fredrik dot hederstierna at securitas-direct dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Apr 2012 20:05:17 -0300
- Subject: Re: [PATCH][Bug cli/14011] New: GDB uses strcpy() with undefined behaviour,causing bug in CLI cd_command().
- References: <OF0A653184.E4780E28-ONC12579EB.00340342-C12579EB.00340362@securitasdirect.se>
Hi Fredrik,
Thanks for the patch.
On Wednesday, April 25 2012, Fredrik Hederstierna wrote:
> Index: gdb/ChangeLog
> ===================================================================
> RCS file: /cvs/src/src/gdb/ChangeLog,v
> retrieving revision 1.14151
> diff -u -p -r1.14151 ChangeLog
> --- gdb/ChangeLog 21 Apr 2012 22:12:57 -0000 1.14151
> +++ gdb/ChangeLog 25 Apr 2012 09:22:32 -0000
> @@ -1,3 +1,8 @@
> +2012-04-25 Fredrik Hederstierna <fredrikh.hederstierna@securitas-direct.com>
> +
> + * cli/cli-cmds.c (cd_command): Use memmove instead of strcpy because the
> + strings overlap.
> +
It's probably better to break the line before the last `because'. You
should also include the number of the PR you're addressing/fixing with
this patch:
2012-04-25 Fredrik Hederstierna <fredrikh.hederstierna@securitas-direct.com>
PR cli/14011
* cli/cli-cmds.c (cd_command): Use memmove instead of strcpy
because the strings overlap.
Also, as Joel said, there are some small nits in the source as well.
If you don't have a copyright assignment for this patch, it's OK (again,
as Joel mentioned, it can be committed as tiny). However, if you intend
to make other contributions to the source code, or if you just want to
request a copyright assignment from FSF "just in case", feel free to
mail me offlist and I can send you the forms.
Thanks.
--
Sergio