From 8d40388f0af79a486b543237b0ca33c597f35fbc Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Feb 15 2017 16:06:33 +0000 Subject: Fix -completion crash (Gary Benson, RH BZ 1398387). --- diff --git a/gdb-upstream.patch b/gdb-upstream.patch index 4a46134..373b7a8 100644 --- a/gdb-upstream.patch +++ b/gdb-upstream.patch @@ -720,3 +720,40 @@ Date: Fri Sep 23 17:27:26 2016 +0100 if (stat (procentry, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) { + + + +http://sourceware.org/ml/gdb-patches/2017-02/msg00226.html +Subject: [OB PATCH] Fix NULL pointer dereference + +This commit fixes a segmentation fault on tab completion when +certain debuginfo is installed: + + https://bugzilla.redhat.com/show_bug.cgi?id=1398387 + +gdb/ChangeLog: + + * symtab.c (add_symtab_completions): Prevent NULL pointer + dereference. +--- + gdb/ChangeLog | 5 +++++ + gdb/symtab.c | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/gdb/symtab.c b/gdb/symtab.c +index 356f480..2c141e5 100644 +--- a/gdb/symtab.c ++++ b/gdb/symtab.c +@@ -5163,6 +5163,9 @@ add_symtab_completions (struct compunit_symtab *cust, + struct block_iterator iter; + int i; + ++ if (cust == NULL) ++ return; ++ + for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++) + { + QUIT; +-- +1.8.3.1 + diff --git a/gdb.spec b/gdb.spec index 7e3c6fb..78cb11b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 7.12.1 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 45%{?dist} +Release: 46%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -1590,6 +1590,9 @@ then fi %changelog +* Wed Feb 15 2017 Jan Kratochvil - 7.12.1-46.fc26 +- Fix -completion crash (Gary Benson, RH BZ 1398387). + * Tue Feb 14 2017 Jan Kratochvil - 7.12.1-45.fc26 - Release bump.