Deleted Added
full compact
elf_strptr.c (164190) elf_strptr.c (179241)
1/*-
2 * Copyright (c) 2006 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Joseph Koshy
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libelf/elf_strptr.c 164190 2006-11-11 17:16:35Z jkoshy $");
28__FBSDID("$FreeBSD: head/lib/libelf/elf_strptr.c 179241 2008-05-23 07:35:36Z jb $");
29
30#include <sys/param.h>
31
32#include <assert.h>
33#include <gelf.h>
34
35#include "_libelf.h"
36

--- 13 unchanged lines hidden (view full) ---

50 LIBELF_SET_ERROR(ARGUMENT, 0);
51 return (NULL);
52 }
53
54 if ((s = elf_getscn(e, scndx)) == NULL ||
55 gelf_getshdr(s, &shdr) == NULL)
56 return (NULL);
57
29
30#include <sys/param.h>
31
32#include <assert.h>
33#include <gelf.h>
34
35#include "_libelf.h"
36

--- 13 unchanged lines hidden (view full) ---

50 LIBELF_SET_ERROR(ARGUMENT, 0);
51 return (NULL);
52 }
53
54 if ((s = elf_getscn(e, scndx)) == NULL ||
55 gelf_getshdr(s, &shdr) == NULL)
56 return (NULL);
57
58 if (shdr.sh_type != SHT_STRTAB ||
58 if (/*shdr.sh_type != SHT_STRTAB || */
59 offset >= shdr.sh_size) {
60 LIBELF_SET_ERROR(ARGUMENT, 0);
61 return (NULL);
62 }
63
64 d = NULL;
65 if (e->e_flags & ELF_F_LAYOUT) {
66

--- 67 unchanged lines hidden ---
59 offset >= shdr.sh_size) {
60 LIBELF_SET_ERROR(ARGUMENT, 0);
61 return (NULL);
62 }
63
64 d = NULL;
65 if (e->e_flags & ELF_F_LAYOUT) {
66

--- 67 unchanged lines hidden ---