This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][Bug cli/14011] New: GDB uses strcpy() with undefined behaviour,causing bug in CLI cd_command().


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]