Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libsa Initialize the marker for the data segment, in...



details:   https://anonhg.NetBSD.org/src/rev/0a1542d3f7a8
branches:  trunk
changeset: 817669:0a1542d3f7a8
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Aug 31 16:22:37 2016 +0000

description:
Initialize the marker for the data segment, in case the caller passes not
fully initialized markers to loadfile().
Pointed out by Mark Cave-Ayland.

diffstat:

 sys/lib/libsa/loadfile_elf32.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r c66190e17cda -r 0a1542d3f7a8 sys/lib/libsa/loadfile_elf32.c
--- a/sys/lib/libsa/loadfile_elf32.c    Wed Aug 31 14:29:13 2016 +0000
+++ b/sys/lib/libsa/loadfile_elf32.c    Wed Aug 31 16:22:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.31 2015/07/25 07:06:11 isaki Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.32 2016/08/31 16:22:37 martin Exp $ */
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -279,6 +279,9 @@
        /* some ports dont use the offset */
        (void)&offset;
 
+       /* have not seen a data segment so far */
+       marks[MARK_DATA] = 0;
+
        internalize_ehdr(elf->e_ident[EI_DATA], elf);
 
        sz = elf->e_phnum * sizeof(Elf_Phdr);



Home | Main Index | Thread Index | Old Index