This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] TUI: avoid calling strcpy() on indentical string objects
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Mon, 27 Apr 2015 18:51:45 +0100
- Subject: Re: [PATCH] TUI: avoid calling strcpy() on indentical string objects
- Authentication-results: sourceware.org; auth=none
- References: <1430061440-20379-1-git-send-email-patrick at parcs dot ath dot cx>
On 04/26/2015 04:17 PM, Patrick Palka wrote:
> In tui_set_source_content(), when offset == 0 the source and destination
> pointers of the call to strcpy() are actually the same. In this case
> not only is strcpy() unnecessary but it is also UB when the two strings
> overlap.
OK.
Boy is that code messy.
Thanks,
Pedro Alves