diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-01-16 14:50:25 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2013-01-19 10:22:41 +0000 |
commit | 96f8058629d99ab689ff233c6133d6cf7f034679 (patch) | |
tree | a6d93378b7d6e18797232c9f571a576eeb5309dc /hw | |
parent | 44687f75434ea938e9d29fdc3696ff4bdc0978fa (diff) |
pc: 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')
-rw-r--r-- | hw/pc.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -693,9 +693,7 @@ static void load_linux(void *fw_cfg, fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_ADDR, cmdline_addr); 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); if (protocol >= 0x202) { stl_p(header+0x228, cmdline_addr); |