]> git.ipfire.org Git - thirdparty/qemu.git/commit
smbios: Fix buffer overrun when using path= option
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 23 Mar 2025 21:35:54 +0000 (22:35 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 10 Apr 2025 12:43:46 +0000 (15:43 +0300)
commitd1960fafecbe1066d3d32c016db364c19a5ddb93
treea4f61cd1c1ef9c9bbd60bc08b9920ddc7f602a74
parent6a3304c84a8363dba3eccd486ab83705dd87e195
smbios: Fix buffer overrun when using path= option

We have to make sure the array of bytes read from the path= file
is null-terminated, otherwise we run into a buffer overrun later on.

Fixes: bb99f4772f54017490e3356ecbb3df25c5d4537f ("hw/smbios: support loading OEM strings values from a file")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2879

Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Valentin David <valentin.david@canonical.com>
Message-ID: <20250323213622.2581013-1-daan.j.demeyer@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit a7a05f5f6a4085afbede315e749b1c67e78c966b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/smbios/smbios.c