Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/epoc32/stand/e32boot/exe Fix fault when 0 byte copy.



details:   https://anonhg.NetBSD.org/src/rev/2eb1e8403db4
branches:  trunk
changeset: 787490:2eb1e8403db4
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Thu Jun 20 15:30:00 2013 +0000

description:
Fix fault when 0 byte copy.

diffstat:

 sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r d39391dec3b1 -r 2eb1e8403db4 sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp
--- a/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp     Thu Jun 20 15:14:03 2013 +0000
+++ b/sys/arch/epoc32/stand/e32boot/exe/e32boot.cpp     Thu Jun 20 15:30:00 2013 +0000
@@ -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 @@
        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();



Home | Main Index | Thread Index | Old Index