Module Name: src
Committed By: martin
Date: Wed Aug 31 16:22:37 UTC 2016
Modified Files:
src/sys/lib/libsa: loadfile_elf32.c
Log Message:
Initialize the marker for the data segment, in case the caller passes not
fully initialized markers to loadfile().
Pointed out by Mark Cave-Ayland.
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/lib/libsa/loadfile_elf32.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.31 src/sys/lib/libsa/loadfile_elf32.c:1.32
--- src/sys/lib/libsa/loadfile_elf32.c:1.31 Sat Jul 25 07:06:11 2015
+++ src/sys/lib/libsa/loadfile_elf32.c Wed Aug 31 16:22:37 2016
@@ -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 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
/* 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);