Module Name: src
Committed By: maya
Date: Sun Oct 15 01:28:32 UTC 2017
Modified Files:
src/sys/arch/ia64/stand/common: load_elf64.c
Log Message:
reorder to avoid null deref before null test
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/common/load_elf64.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/arch/ia64/stand/common/load_elf64.c
diff -u src/sys/arch/ia64/stand/common/load_elf64.c:1.3 src/sys/arch/ia64/stand/common/load_elf64.c:1.4
--- src/sys/arch/ia64/stand/common/load_elf64.c:1.3 Mon Aug 15 08:24:05 2016
+++ src/sys/arch/ia64/stand/common/load_elf64.c Sun Oct 15 01:28:32 2017
@@ -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 <[email protected]>
@@ -62,7 +62,6 @@ elf64_loadfile(char *filename, u_int64_t
return(EFTYPE);
fp = file_alloc();
- marks = fp->marks;
if (fp == NULL) {
printf("elf64_loadfile: cannot allocate module info\n");
@@ -70,6 +69,7 @@ elf64_loadfile(char *filename, u_int64_t
goto out;
}
+ marks = fp->marks;
fp->f_name = strdup(filename);
fp->f_type = strdup(ELF64_KERNELTYPE);