From 4f9130878801a2bc5457ae6570902faf437baf7a7d316d5023635f6dc82ff1c4 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Tue, 22 Sep 2009 07:42:05 +0000 Subject: [PATCH 1/3] OBS-URL: https://build.opensuse.org/package/show/Base:System/ptools?expand=0&rev=4 --- commit-a42a099 | 33 +++++++++++++++++++++++++++++++++ ptools.changes | 5 +++++ ptools.spec | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 commit-a42a099 diff --git a/commit-a42a099 b/commit-a42a099 new file mode 100644 index 0000000..5ad83ea --- /dev/null +++ b/commit-a42a099 @@ -0,0 +1,33 @@ +commit a42a0991797ab10c04bbcdf7cc2846c5da5bbd25 +Author: Jan Blunck +Date: Mon Sep 21 17:57:02 2009 +0200 + + Fix crash in map_seach_ehdr() + + When searching for the ELF header check if libelf returned a valid pointer + before referencing it. + + https://crashdb.opensuse.org/log/show/b75d1730f4c944b092afd8f302fe76b7 + + Signed-off-by: Jan Blunck + +--- + src/pbuildid.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Index: b/src/pbuildid.c +=================================================================== +--- a/src/pbuildid.c ++++ b/src/pbuildid.c +@@ -467,6 +467,11 @@ static Elf *map_search_ehdr(struct core_ + /* Look for ELF header in this LOAD segment */ + data = elf_getdata_rawchunk (map->elf, map->p_offset, + map->p_filesz, ELF_T_EHDR); ++ if (!data) { ++ fprintf(stderr, "Couldn't read LOAD segment: %s\n", ++ elf_errmsg(-1)); ++ return NULL; ++ } + e_ident = (unsigned char *)data->d_buf; + if (memcmp (e_ident, ELFMAG, SELFMAG) != 0 + || e_ident[EI_CLASS] <= ELFCLASSNONE diff --git a/ptools.changes b/ptools.changes index c57d7ba..59318d6 100644 --- a/ptools.changes +++ b/ptools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 21 17:59:50 CEST 2009 - jblunck@suse.de + +- Fix crash in map_seach_ehdr(). + ------------------------------------------------------------------- Tue Feb 3 10:37:08 CET 2009 - jblunck@suse.de diff --git a/ptools.spec b/ptools.spec index b37406a..a83e7f3 100644 --- a/ptools.spec +++ b/ptools.spec @@ -26,6 +26,7 @@ License: GPL v2 or later Group: Development/Tools/Debuggers Source: %{name}-%{version}.tar.bz2 Patch0: output-l_addr.diff +Patch1: commit-a42a099 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libelf-devel popt-devel AutoReqProv: on @@ -44,6 +45,7 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %configure From c706781ca312c566dade0495f3aa7309f3dcac46bf519d5c9bcaf3c596f4c79e Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Tue, 22 Sep 2009 21:50:01 +0000 Subject: [PATCH 2/3] checked in OBS-URL: https://build.opensuse.org/package/show/Base:System/ptools?expand=0&rev=5 --- commit-a42a099 | 33 --------------------------------- ptools.changes | 5 ----- ptools.spec | 2 -- 3 files changed, 40 deletions(-) delete mode 100644 commit-a42a099 diff --git a/commit-a42a099 b/commit-a42a099 deleted file mode 100644 index 5ad83ea..0000000 --- a/commit-a42a099 +++ /dev/null @@ -1,33 +0,0 @@ -commit a42a0991797ab10c04bbcdf7cc2846c5da5bbd25 -Author: Jan Blunck -Date: Mon Sep 21 17:57:02 2009 +0200 - - Fix crash in map_seach_ehdr() - - When searching for the ELF header check if libelf returned a valid pointer - before referencing it. - - https://crashdb.opensuse.org/log/show/b75d1730f4c944b092afd8f302fe76b7 - - Signed-off-by: Jan Blunck - ---- - src/pbuildid.c | 5 +++++ - 1 file changed, 5 insertions(+) - -Index: b/src/pbuildid.c -=================================================================== ---- a/src/pbuildid.c -+++ b/src/pbuildid.c -@@ -467,6 +467,11 @@ static Elf *map_search_ehdr(struct core_ - /* Look for ELF header in this LOAD segment */ - data = elf_getdata_rawchunk (map->elf, map->p_offset, - map->p_filesz, ELF_T_EHDR); -+ if (!data) { -+ fprintf(stderr, "Couldn't read LOAD segment: %s\n", -+ elf_errmsg(-1)); -+ return NULL; -+ } - e_ident = (unsigned char *)data->d_buf; - if (memcmp (e_ident, ELFMAG, SELFMAG) != 0 - || e_ident[EI_CLASS] <= ELFCLASSNONE diff --git a/ptools.changes b/ptools.changes index 59318d6..c57d7ba 100644 --- a/ptools.changes +++ b/ptools.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Mon Sep 21 17:59:50 CEST 2009 - jblunck@suse.de - -- Fix crash in map_seach_ehdr(). - ------------------------------------------------------------------- Tue Feb 3 10:37:08 CET 2009 - jblunck@suse.de diff --git a/ptools.spec b/ptools.spec index a83e7f3..b37406a 100644 --- a/ptools.spec +++ b/ptools.spec @@ -26,7 +26,6 @@ License: GPL v2 or later Group: Development/Tools/Debuggers Source: %{name}-%{version}.tar.bz2 Patch0: output-l_addr.diff -Patch1: commit-a42a099 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libelf-devel popt-devel AutoReqProv: on @@ -45,7 +44,6 @@ Authors: %prep %setup -q %patch0 -p1 -%patch1 -p1 %build %configure From 4fcbe37d445c6b91e66d51d2c3b852d55fe0c7ecc5d21891985965eff693e777 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 22 Sep 2009 21:50:02 +0000 Subject: [PATCH 3/3] Updating link to change in openSUSE:Factory/ptools revision 3.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/ptools?expand=0&rev=e7a87cc168a421d81c2fdc1e4d4a43cb --- commit-a42a099 | 33 +++++++++++++++++++++++++++++++++ ptools.changes | 5 +++++ ptools.spec | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 commit-a42a099 diff --git a/commit-a42a099 b/commit-a42a099 new file mode 100644 index 0000000..5ad83ea --- /dev/null +++ b/commit-a42a099 @@ -0,0 +1,33 @@ +commit a42a0991797ab10c04bbcdf7cc2846c5da5bbd25 +Author: Jan Blunck +Date: Mon Sep 21 17:57:02 2009 +0200 + + Fix crash in map_seach_ehdr() + + When searching for the ELF header check if libelf returned a valid pointer + before referencing it. + + https://crashdb.opensuse.org/log/show/b75d1730f4c944b092afd8f302fe76b7 + + Signed-off-by: Jan Blunck + +--- + src/pbuildid.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Index: b/src/pbuildid.c +=================================================================== +--- a/src/pbuildid.c ++++ b/src/pbuildid.c +@@ -467,6 +467,11 @@ static Elf *map_search_ehdr(struct core_ + /* Look for ELF header in this LOAD segment */ + data = elf_getdata_rawchunk (map->elf, map->p_offset, + map->p_filesz, ELF_T_EHDR); ++ if (!data) { ++ fprintf(stderr, "Couldn't read LOAD segment: %s\n", ++ elf_errmsg(-1)); ++ return NULL; ++ } + e_ident = (unsigned char *)data->d_buf; + if (memcmp (e_ident, ELFMAG, SELFMAG) != 0 + || e_ident[EI_CLASS] <= ELFCLASSNONE diff --git a/ptools.changes b/ptools.changes index c57d7ba..59318d6 100644 --- a/ptools.changes +++ b/ptools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 21 17:59:50 CEST 2009 - jblunck@suse.de + +- Fix crash in map_seach_ehdr(). + ------------------------------------------------------------------- Tue Feb 3 10:37:08 CET 2009 - jblunck@suse.de diff --git a/ptools.spec b/ptools.spec index b37406a..99b45f1 100644 --- a/ptools.spec +++ b/ptools.spec @@ -21,11 +21,12 @@ Url: ftp://ftp.suse.com/pub/people/jblunck/ptools/ Name: ptools Summary: The process tools collection Version: 0.1 -Release: 3 +Release: 4 License: GPL v2 or later Group: Development/Tools/Debuggers Source: %{name}-%{version}.tar.bz2 Patch0: output-l_addr.diff +Patch1: commit-a42a099 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libelf-devel popt-devel AutoReqProv: on @@ -44,6 +45,7 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %configure