Skip to content

Commit cd8a35b

Browse files
akihikodakiMichael Tokarev
authored and
Michael Tokarev
committed
hw/smbios: Fix OEM strings table option validation
qemu_smbios_type11_opts did not have the list terminator and that resulted in out-of-bound memory access. It also needs to have an element for the type option. Cc: [email protected] Fixes: 2d6dcbf ("smbios: support setting OEM strings table") Signed-off-by: Akihiko Odaki <[email protected]> Reviewed-by: Michael Tokarev <[email protected]> Reviewed-by: Ani Sinha <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael Tokarev <[email protected]>
1 parent 9953bf3 commit cd8a35b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: hw/smbios/smbios.c

+6
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ static const QemuOptDesc qemu_smbios_type8_opts[] = {
375375
};
376376

377377
static const QemuOptDesc qemu_smbios_type11_opts[] = {
378+
{
379+
.name = "type",
380+
.type = QEMU_OPT_NUMBER,
381+
.help = "SMBIOS element type",
382+
},
378383
{
379384
.name = "value",
380385
.type = QEMU_OPT_STRING,
@@ -385,6 +390,7 @@ static const QemuOptDesc qemu_smbios_type11_opts[] = {
385390
.type = QEMU_OPT_STRING,
386391
.help = "OEM string data from file",
387392
},
393+
{ /* end of list */ }
388394
};
389395

390396
static const QemuOptDesc qemu_smbios_type17_opts[] = {

0 commit comments

Comments
 (0)