aboutsummaryrefslogtreecommitdiff
path: root/hw/sun4u.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-16 14:50:26 +0100
committerBlue Swirl <blauwirbel@gmail.com>2013-01-19 10:22:42 +0000
commit0e0d2d6295076815ded8d0868b7b806380df5dda (patch)
treec4012cdba59cf0bad48caade9192b212f3fb27cf /hw/sun4u.c
parent96f8058629d99ab689ff233c6133d6cf7f034679 (diff)
sun4: Fix unchecked strdup() by switching to fw_cfg_add_string()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sun4u.c')
-rw-r--r--hw/sun4u.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c
index cb75d03278..d36acde545 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -886,9 +886,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
if (kernel_cmdline) {
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE,
strlen(kernel_cmdline) + 1);
- fw_cfg_add_bytes(fw_cfg, FW_CFG_CMDLINE_DATA,
- (uint8_t*)strdup(kernel_cmdline),
- strlen(kernel_cmdline) + 1);
+ fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline);
} else {
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0);
}