Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/ia64/stand/common reorder to avoid null deref befor...



details:   https://anonhg.NetBSD.org/src/rev/a6a4b202b09d
branches:  trunk
changeset: 827111:a6a4b202b09d
user:      maya <maya%NetBSD.org@localhost>
date:      Sun Oct 15 01:28:32 2017 +0000

description:
reorder to avoid null deref before null test

diffstat:

 sys/arch/ia64/stand/common/load_elf64.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 1042a96ddc42 -r a6a4b202b09d sys/arch/ia64/stand/common/load_elf64.c
--- a/sys/arch/ia64/stand/common/load_elf64.c   Sat Oct 14 21:21:51 2017 +0000
+++ b/sys/arch/ia64/stand/common/load_elf64.c   Sun Oct 15 01:28:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: load_elf64.c,v 1.3 2016/08/15 08:24:05 maxv Exp $      */
+/*     $NetBSD: load_elf64.c,v 1.4 2017/10/15 01:28:32 maya Exp $      */
 
 /*-
  * Copyright (c) 1998 Michael Smith <msmith%freebsd.org@localhost>
@@ -62,7 +62,6 @@
        return(EFTYPE);
 
     fp = file_alloc();
-    marks = fp->marks;
 
     if (fp == NULL) {
            printf("elf64_loadfile: cannot allocate module info\n");
@@ -70,6 +69,7 @@
            goto out;
     }
 
+    marks = fp->marks;
     fp->f_name = strdup(filename);
     fp->f_type = strdup(ELF64_KERNELTYPE);
 



Home | Main Index | Thread Index | Old Index