All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] multiboot: copy the cmdline verbatim
@ 2016-12-14 16:19 Vlad Lungu
  2016-12-14 16:55 ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Vlad Lungu @ 2016-12-14 16:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, ehabkost, rth, Vlad Lungu

get_opt_value() truncates the value at the first comma.
Use memcpy() instead.

Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
---
 hw/i386/multiboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 387caa6..b4495ad 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -109,7 +109,7 @@ static uint32_t mb_add_cmdline(MultibootState *s, const char *cmdline)
     hwaddr p = s->offset_cmdlines;
     char *b = (char *)s->mb_buf + p;
 
-    get_opt_value(b, strlen(cmdline) + 1, cmdline);
+    memcpy(b, cmdline, strlen(cmdline) + 1);
     s->offset_cmdlines += strlen(b) + 1;
     return s->mb_buf_phys + p;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [Qemu-devel] [PATCH] multiboot: copy the cmdline verbatim
@ 2016-12-14 13:35 Vlad Lungu
  2016-12-14 14:38 ` Eduardo Habkost
  0 siblings, 1 reply; 11+ messages in thread
From: Vlad Lungu @ 2016-12-14 13:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, ehabkost, rth


get_opt_value() truncates the value at the first comma
Use memcpy() instead

Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
---
  hw/i386/multiboot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index 387caa6..b4495ad 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -109,7 +109,7 @@ static uint32_t mb_add_cmdline(MultibootState *s, 
const char *cmdline)
      hwaddr p = s->offset_cmdlines;
      char *b = (char *)s->mb_buf + p;

-    get_opt_value(b, strlen(cmdline) + 1, cmdline);
+    memcpy(b, cmdline, strlen(cmdline) + 1);
      s->offset_cmdlines += strlen(b) + 1;
      return s->mb_buf_phys + p;
  }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-12-15  9:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 16:19 [Qemu-devel] [PATCH] multiboot: copy the cmdline verbatim Vlad Lungu
2016-12-14 16:55 ` Paolo Bonzini
2016-12-14 17:00   ` Eduardo Habkost
2016-12-14 17:20     ` Paolo Bonzini
2016-12-14 17:51       ` Eduardo Habkost
2016-12-14 21:38         ` Paolo Bonzini
2016-12-14 22:26           ` Eduardo Habkost
2016-12-14 22:32             ` Paolo Bonzini
2016-12-15  9:44               ` Vlad Lungu
  -- strict thread matches above, loose matches on Subject: below --
2016-12-14 13:35 Vlad Lungu
2016-12-14 14:38 ` Eduardo Habkost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.