CVS commit: src/sys/arch/ia64/stand/common

2017-12-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 10 02:32:03 UTC 2017

Modified Files:
src/sys/arch/ia64/stand/common: bootstrap.h misc.c

Log Message:
comment out unused hexdump


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/stand/common/bootstrap.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/stand/common/misc.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/bootstrap.h
diff -u src/sys/arch/ia64/stand/common/bootstrap.h:1.9 src/sys/arch/ia64/stand/common/bootstrap.h:1.10
--- src/sys/arch/ia64/stand/common/bootstrap.h:1.9	Tue Mar 25 14:35:32 2014
+++ src/sys/arch/ia64/stand/common/bootstrap.h	Sat Dec  9 21:32:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootstrap.h,v 1.9 2014/03/25 18:35:32 christos Exp $	*/
+/*	$NetBSD: bootstrap.h,v 1.10 2017/12/10 02:32:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 Michael Smith 
@@ -79,7 +79,9 @@ int	getrootmount(char *rootdev);
 
 /* misc.c */
 char	*unargv(int argc, char *argv[]);
+#if 0
 void	hexdump(void *region, size_t len);
+#endif
 size_t	strlenout(vaddr_t str);
 char	*strdupout(vaddr_t str);
 void	kern_bzero(vaddr_t dest, size_t len);

Index: src/sys/arch/ia64/stand/common/misc.c
diff -u src/sys/arch/ia64/stand/common/misc.c:1.7 src/sys/arch/ia64/stand/common/misc.c:1.8
--- src/sys/arch/ia64/stand/common/misc.c:1.7	Tue Mar 25 14:35:32 2014
+++ src/sys/arch/ia64/stand/common/misc.c	Sat Dec  9 21:32:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.7 2014/03/25 18:35:32 christos Exp $	*/
+/*	$NetBSD: misc.c,v 1.8 2017/12/10 02:32:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 Michael Smith 
@@ -166,6 +166,7 @@ alloc_pread(int fd, off_t off, size_t le
 	return (buf);
 }
 
+#if 0
 /*
  * Display a region in traditional hexdump format.
  */
@@ -205,6 +206,7 @@ hexdump(void *region, size_t len)
 }
 pager_close();
 }
+#endif
 
 void
 dev_cleanup(void)



CVS commit: src/sys/arch/ia64/stand/common

2017-10-14 Thread Maya Rashish
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 
@@ -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);
 



CVS commit: src/sys/arch/ia64/stand/common

2016-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Aug 15 08:24:05 UTC 2016

Modified Files:
src/sys/arch/ia64/stand/common: load_elf64.c

Log Message:
Uninitialized var, found by brainy; not tested, but obvious enough


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/arch/ia64/stand/common/load_elf64.c:1.3
--- src/sys/arch/ia64/stand/common/load_elf64.c:1.2	Sat Apr 22 07:58:53 2006
+++ src/sys/arch/ia64/stand/common/load_elf64.c	Mon Aug 15 08:24:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: load_elf64.c,v 1.2 2006/04/22 07:58:53 cherry Exp $	*/
+/*	$NetBSD: load_elf64.c,v 1.3 2016/08/15 08:24:05 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998 Michael Smith 
@@ -75,8 +75,10 @@ elf64_loadfile(char *filename, u_int64_t
 
 marks[MARK_START] = dest;
 
-if ((fd = loadfile(filename, marks, LOAD_KERNEL)) == -1)
+if ((fd = loadfile(filename, marks, LOAD_KERNEL)) == -1) {
+	err = EPERM;
 	goto oerr;
+}
 close(fd);
 
 dest = marks[MARK_ENTRY];



CVS commit: src/sys/arch/ia64/stand/common

2016-02-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  1 17:38:31 UTC 2016

Modified Files:
src/sys/arch/ia64/stand/common: dev_net.c

Log Message:
PR/50736: David Binderman: Check bounds before dereferencing.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/stand/common/dev_net.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/dev_net.c
diff -u src/sys/arch/ia64/stand/common/dev_net.c:1.9 src/sys/arch/ia64/stand/common/dev_net.c:1.10
--- src/sys/arch/ia64/stand/common/dev_net.c:1.9	Tue Mar 25 14:35:32 2014
+++ src/sys/arch/ia64/stand/common/dev_net.c	Mon Feb  1 12:38:31 2016
@@ -1,5 +1,5 @@
 /*	
- * $NetBSD: dev_net.c,v 1.9 2014/03/25 18:35:32 christos Exp $
+ * $NetBSD: dev_net.c,v 1.10 2016/02/01 17:38:31 christos Exp $
  */
 
 /*-
@@ -265,7 +265,7 @@ net_getparams(int sock)
  * before passing it along.  This allows us to be compatible with
  * the kernel's diskless (BOOTP_NFSROOT) booting conventions
  */
-for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
+for (i = 0; i < FNAME_SIZE && rootpath[i] != '\0'; i++)
 	if (rootpath[i] == ':')
 		break;
 if (i && i != FNAME_SIZE && rootpath[i] == ':') {



CVS commit: src/sys/arch/ia64/stand/common

2013-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 21:22:16 UTC 2013

Modified Files:
src/sys/arch/ia64/stand/common: fileload.c

Log Message:
fix uninitialized variable
http://M00nBSD.net/ae123a9bae03f7dde5c6d654412daf5a.html


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/common/fileload.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/fileload.c
diff -u src/sys/arch/ia64/stand/common/fileload.c:1.3 src/sys/arch/ia64/stand/common/fileload.c:1.4
--- src/sys/arch/ia64/stand/common/fileload.c:1.3	Thu Dec 27 15:21:51 2012
+++ src/sys/arch/ia64/stand/common/fileload.c	Thu Jun 27 17:22:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fileload.c,v 1.3 2012/12/27 20:21:51 martin Exp $	*/
+/*	$NetBSD: fileload.c,v 1.4 2013/06/27 21:22:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 Michael Smith msm...@freebsd.org
@@ -61,7 +61,7 @@ int
 command_load(int argc, char *argv[])
 {
 char	*typestr;
-int		dofile, dokld, ch, error;
+int		dofile, dokld, ch;
 
 dokld = dofile = 0;
 optind = 1;
@@ -89,11 +89,12 @@ command_load(int argc, char *argv[])
  * Do we have explicit KLD load ?
  */
 if (dokld || file_havepath(argv[1])) {
-	error = file_loadkernel(argv[1], argc - 2, argv + 2);
+	int error = file_loadkernel(argv[1], argc - 2, argv + 2);
 	if (error == EEXIST)
 	sprintf(command_errbuf, warning: KLD '%s' already loaded, argv[1]);
+	return error == 0 ? CMD_OK : CMD_ERROR;
 }
-return (error == 0 ? CMD_OK : CMD_ERROR);
+return CMD_OK;
 }