summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boot/ChangeLog4
-rw-r--r--boot/boot.c17
2 files changed, 16 insertions, 5 deletions
diff --git a/boot/ChangeLog b/boot/ChangeLog
index 968560ff..b1e3a6ad 100644
--- a/boot/ChangeLog
+++ b/boot/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-15 Thomas Schwinge <tschwinge@gnu.org>
+
+ * boot.c (boot_script_exec_cmd): Fix invalid lvalues.
+
2003-01-04 Roland McGrath <roland@frob.com>
* boot_script.c (boot_script_parse_line): Copy the file name into
diff --git a/boot/boot.c b/boot/boot.c
index 7530acf1..33e1930e 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1,6 +1,7 @@
/* Load a task using the single server, and then run it
as if we were the kernel.
- Copyright (C) 1993,94,95,96,97,98,99,2000,01,02 Free Software Foundation, Inc.
+ Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,2006
+ Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -367,11 +368,17 @@ boot_script_exec_cmd (void *hook,
str_start = ((vm_address_t) arg_pos
+ (argc + 2) * sizeof (char *) + sizeof (integer_t));
p = args + ((vm_address_t) arg_pos & (vm_page_size - 1));
- *((int *) p)++ = argc;
+ *(int *) p = argc;
+ p = (void *) p + sizeof (int);
for (i = 0; i < argc; i++)
- *((char **) p)++ = argv[i] - strings + (char *) str_start;
- *((char **) p)++ = 0;
- *((char **) p)++ = 0;
+ {
+ *(char **) p = argv[i] - strings + (char *) str_start;
+ p = (void *) p + sizeof (char *);
+ }
+ *(char **) p = 0;
+ p = (void *) p + sizeof (char *);
+ *(char **) p = 0;
+ p = (void *) p + sizeof (char *);
memcpy (p, strings, stringlen);
bzero (args, (vm_offset_t) arg_pos & (vm_page_size - 1));
vm_write (task, trunc_page ((vm_offset_t) arg_pos), (vm_address_t) args,