Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet/dist/lib/libdtrace/common Don't crash wh...



details:   https://anonhg.NetBSD.org/src/rev/04cdd568dc0a
branches:  trunk
changeset: 814044:04cdd568dc0a
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Mar 01 21:09:17 2016 +0000

description:
Don't crash when relocbase was 0.

diffstat:

 external/cddl/osnet/dist/lib/libdtrace/common/drti.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r ef1c16a55671 -r 04cdd568dc0a external/cddl/osnet/dist/lib/libdtrace/common/drti.c
--- a/external/cddl/osnet/dist/lib/libdtrace/common/drti.c      Tue Mar 01 21:00:52 2016 +0000
+++ b/external/cddl/osnet/dist/lib/libdtrace/common/drti.c      Tue Mar 01 21:09:17 2016 +0000
@@ -149,7 +149,7 @@
        elf = (void *)lmp->l_addr;
 
        dh.dofhp_dof = (uintptr_t)dof;
-       dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
+       dh.dofhp_addr = elf && elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0;
 #if defined(__FreeBSD__) || defined(__NetBSD__)
        dh.dofhp_pid = getpid();
 #endif



Home | Main Index | Thread Index | Old Index