u-boot/0011-smbios-Fix-table-when-no-string-is-.patch
Matthias Brugger 7f03d9189a - Update to 2024.10:
* Full changelog available at:
    https://source.denx.de/u-boot/u-boot/-/compare/v2024.10...v2025.01
Patch queue updated from https://github.com/openSUSE/u-boot.git tumbleweed-2025.01
* Patches dropped:
  0016-cmd-boot-add-brom-cmd-to-reboot-to-.patch
  0017-riscv-dts-jh7110-Update-qspi-node-w.patch
  0018-Revert-riscv-dts-jh7110-Update-qspi.patch
  0019-scripts-dtc-pylibfdt-libfdt.i_shipp.patch

OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=227
2025-01-21 15:13:53 +00:00

34 lines
1.0 KiB
Diff

From ab7dc6980cdc163b0b504bf5e0460b74713a729a Mon Sep 17 00:00:00 2001
From: Matthias Brugger <mbrugger@suse.com>
Date: Wed, 17 Mar 2021 12:20:32 +0100
Subject: [PATCH] smbios: Fix table when no string is present
When no string is present in a table, next_ptr points to the same
location as eos. When calculating the string table length, we would only
reserve one \0. By spec a SMBIOS table has to end with two \0\0 when no
strings a present.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Series-to: sjg@chromium.org
Series-cc: bmeng.cn@gmail.com
Series-cc: xypron.glpk@gmx.de
Series-cc: u-boot@lists.denx.de
---
lib/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/smbios.c b/lib/smbios.c
index 7c24ea129e..2db30bf610 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -276,7 +276,7 @@ static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop,
static void smbios_set_eos(struct smbios_ctx *ctx, char *eos)
{
ctx->eos = eos;
- ctx->next_ptr = eos;
+ ctx->next_ptr = eos + 1;
ctx->last_str = NULL;
}