WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [PATCH] Check for NULL source pointer

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [PATCH] Check for NULL source pointer
From: Amos Waterland <apw@xxxxxxxxxx>
Date: Tue, 27 Mar 2007 19:18:45 -0400
Delivery-date: Tue, 27 Mar 2007 16:17:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
While debugging the zImage problem on a JS21, I noticed that DOM0
bootargs was filled with bogus characters.  I believe something like
this is necessary.

Signed-off-by: Amos Waterland <apw@xxxxxxxxxx>

---

 ofd_fixup.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -r cc72b77132f9 xen/arch/powerpc/ofd_fixup.c
--- a/xen/arch/powerpc/ofd_fixup.c      Wed Mar 21 18:29:49 2007 -0500
+++ b/xen/arch/powerpc/ofd_fixup.c      Tue Mar 27 19:13:03 2007 -0400
@@ -276,7 +276,10 @@ static ofdn_t ofd_chosen_props(void *m, 
                      &path[1], sizeof (path) - 1);
     }
 
-    strlcpy(bootargs, cmdline, sizeof(bootargs));
+    memset(bootargs, 0, sizeof(bootargs));
+    if (cmdline) {
+        strlcpy(bootargs, cmdline, sizeof(bootargs));
+    }
     bsz = strlen(bootargs) + 1;
     rm = sizeof (bootargs) - bsz;
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>