This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix PR cli/23785: Check if file exists when invoking "restore FILE binary"
- From: Tom Tromey <tom at tromey dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Thu, 18 Oct 2018 15:17:50 -0600
- Subject: Re: [PATCH] Fix PR cli/23785: Check if file exists when invoking "restore FILE binary"
- References: <20181018170051.15851-1-sergiodj@redhat.com>
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> This simple patch fixes the segfault reported on PR cli/23785, which
Sergio> happens when using the "restore FILE binary" command with a
Sergio> non-existent file. We just have to check if the file handler returned
Sergio> by "gdb_fopen_cloexec" is not NULL, and error out if it is.
Sergio> A test has also been added to gdb.base/restore.exp in order to
Sergio> exercise this scenario.
Thanks, this is ok.
Tom