forked from kushaldas/elfutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject requests for abbreviation with code 0
- Loading branch information
Petr Machata
committed
Mar 10, 2011
1 parent
d76bd7a
commit 02c5619
Showing
6 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2011-03-10 Petr Machata <[email protected]> | ||
|
||
* libdw/dwarf_tag.c (__libdw_findabbrev): Reject requests for | ||
abbreviation with code 0. | ||
|
||
2011-03-09 Petr Machata <[email protected]> | ||
|
||
* libdw/dwarf_child.c (dwarf_child): Check for section overrun. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* Return tag of given DIE. | ||
Copyright (C) 2003, 2004, 2005, 2006, 2008 Red Hat, Inc. | ||
Copyright (C) 2003-2011 Red Hat, Inc. | ||
This file is part of Red Hat elfutils. | ||
Written by Ulrich Drepper <[email protected]>, 2003. | ||
|
@@ -61,6 +61,10 @@ __libdw_findabbrev (struct Dwarf_CU *cu, unsigned int code) | |
{ | ||
Dwarf_Abbrev *abb; | ||
|
||
/* Abbreviation code can never have a value of 0. */ | ||
if (unlikely (code == 0)) | ||
return DWARF_END_ABBREV; | ||
|
||
/* See whether the entry is already in the hash table. */ | ||
abb = Dwarf_Abbrev_Hash_find (&cu->abbrev_hash, code, NULL); | ||
if (abb == NULL) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* Copyright (C) 2011 Red Hat, Inc. | ||
This file is part of Red Hat elfutils. | ||
Red Hat elfutils is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by the | ||
Free Software Foundation; version 2 of the License. | ||
Red Hat elfutils is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the GNU General Public License along | ||
with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
Red Hat elfutils is an included package of the Open Invention Network. | ||
An included package of the Open Invention Network is a package for which | ||
Open Invention Network licensees cross-license their patents. No patent | ||
license is granted, either expressly or impliedly, by designation as an | ||
included package. Should you wish to participate in the Open Invention | ||
Network licensing program, please visit www.openinventionnetwork.com | ||
<http://www.openinventionnetwork.com>. */ | ||
|
||
#include <config.h> | ||
|
||
#include ELFUTILS_HEADER(dw) | ||
#include <fcntl.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <assert.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
assert (argc > 1); | ||
|
||
int i = open(argv[1], O_RDONLY); | ||
assert (i >= 0); | ||
|
||
Dwarf *dw = dwarf_begin(i, DWARF_C_READ); | ||
assert (dw != NULL); | ||
|
||
Dwarf_Die die_mem, *die; | ||
die = dwarf_offdie (dw, 11, &die_mem); | ||
assert (die == &die_mem); | ||
assert (dwarf_tag (die) == 0); | ||
|
||
die = dwarf_offdie (dw, 11, &die_mem); | ||
assert (die == &die_mem); | ||
assert (dwarf_tag (die) == 0); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /bin/sh | ||
# Copyright (C) 2011 Red Hat, Inc. | ||
# This file is part of Red Hat elfutils. | ||
# | ||
# Red Hat elfutils is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by the | ||
# Free Software Foundation; version 2 of the License. | ||
# | ||
# Red Hat elfutils is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with Red Hat elfutils; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. | ||
# | ||
# Red Hat elfutils is an included package of the Open Invention Network. | ||
# An included package of the Open Invention Network is a package for which | ||
# Open Invention Network licensees cross-license their patents. No patent | ||
# license is granted, either expressly or impliedly, by designation as an | ||
# included package. Should you wish to participate in the Open Invention | ||
# Network licensing program, please visit www.openinventionnetwork.com | ||
# <http://www.openinventionnetwork.com>. | ||
|
||
. $srcdir/test-subr.sh | ||
|
||
testfiles testfile56 | ||
|
||
testrun_compare ./rerequest_tag testfile56 <<\EOF | ||
EOF | ||
|
||
exit 0 |
Binary file not shown.