This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug cli/23785] Segmentation fault (restore non-existent-file binary)
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 18 Oct 2018 21:40:18 +0000
- Subject: [Bug cli/23785] Segmentation fault (restore non-existent-file binary)
- Auto-submitted: auto-generated
- References: <bug-23785-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23785
--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sergio Durigan Junior
<sergiodj@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=94c18618a8e29894a7b3104375e0510d71a568fb
commit 94c18618a8e29894a7b3104375e0510d71a568fb
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Thu Oct 18 12:56:25 2018 -0400
Fix PR cli/23785: Check if file exists when invoking "restore FILE binary"
This simple patch fixes the segfault reported on PR cli/23785, which
happens when using the "restore FILE binary" command with a
non-existent file. We just have to check if the file handler returned
by "gdb_fopen_cloexec" is not NULL, and error out if it is.
A test has also been added to gdb.base/restore.exp in order to
exercise this scenario.
No regressions introduced.
gdb/ChangeLog:
2018-10-18 Sergio Durigan Junior <sergiodj@redhat.com>
PR cli/23785
* cli/cli-dump.c (restore_binary_file): Check if "file" is
NULL.
gdb/testsuite/ChangeLog:
2018-10-18 Sergio Durigan Junior <sergiodj@redhat.com>
PR cli/23785
* gdb.base/restore.exp: New test to check if "restore" with an
invalid file doesn't segfault.
--
You are receiving this mail because:
You are on the CC list for the bug.