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

[XenPPC] [PATCH] Check for NULL source pointer



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.