Skip to content

Commit 196578c

Browse files
akihikodakiMichael Tokarev
authored and
Michael Tokarev
committed
hw/smbios: Fix port connector option validation
qemu_smbios_type8_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: fd8caa2 ("hw/smbios: support for type 8 (port connector)") 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 cd8a35b commit 196578c

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
@@ -352,6 +352,11 @@ static const QemuOptDesc qemu_smbios_type4_opts[] = {
352352
};
353353

354354
static const QemuOptDesc qemu_smbios_type8_opts[] = {
355+
{
356+
.name = "type",
357+
.type = QEMU_OPT_NUMBER,
358+
.help = "SMBIOS element type",
359+
},
355360
{
356361
.name = "internal_reference",
357362
.type = QEMU_OPT_STRING,
@@ -372,6 +377,7 @@ static const QemuOptDesc qemu_smbios_type8_opts[] = {
372377
.type = QEMU_OPT_NUMBER,
373378
.help = "port type",
374379
},
380+
{ /* end of list */ }
375381
};
376382

377383
static const QemuOptDesc qemu_smbios_type11_opts[] = {

0 commit comments

Comments
 (0)