Module Name:    src
Committed By:   kiyohara
Date:           Thu Jun 20 15:30:00 UTC 2013

Modified Files:
        src/sys/arch/epoc32/stand/e32boot/exe: e32boot.cpp

Log Message:
Fix fault when 0 byte copy.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp

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/epoc32/stand/e32boot/exe/e32boot.cpp
diff -u src/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp:1.2 src/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp:1.3
--- src/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp:1.2	Thu Jun 20 13:36:48 2013
+++ src/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp	Thu Jun 20 15:30:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: e32boot.cpp,v 1.2 2013/06/20 13:36:48 kiyohara Exp $	*/
+/*	$NetBSD: e32boot.cpp,v 1.3 2013/06/20 15:30:00 kiyohara Exp $	*/
 /*
  * Copyright (c) 2012, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -173,7 +173,9 @@ E32BootL(void)
 	int n, m;
 	n = sizeof(bootargs->bootargs);
 	m = (*netbsd->GetArgs()).Length();
-	Mem::Copy(bootargs->bootargs, &(*netbsd->GetArgs())[0], n < m ? n : m);
+	if (m > 0)
+		Mem::Copy(bootargs->bootargs, &(*netbsd->GetArgs())[0],
+		    n < m ? n : m);
 	bootargs->bootargs[n < m ? n - 1 : m] = '\0';
 
 	netbsd->ParseHeader();

Reply via email to