summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--OvmfPkg/Include/Library/QemuFwCfgLib.h6
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
index 8d3b835d43..baaa257d61 100644
--- a/OvmfPkg/Include/Library/QemuFwCfgLib.h
+++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h
@@ -17,6 +17,12 @@
#ifndef __FW_CFG_LIB__
#define __FW_CFG_LIB__
+//
+// The size, in bytes, of names of firmware configuration files, including at
+// least one terminating NUL byte.
+//
+#define QEMU_FW_CFG_FNAME_SIZE 56
+
typedef enum {
QemuFwCfgItemSignature = 0x0000,
QemuFwCfgItemInterfaceVersion = 0x0001,
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 92c85c1d3d..24424f83a9 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -278,7 +278,7 @@ QemuFwCfgFindFile (
UINT32 FileSize;
UINT16 FileSelect;
UINT16 FileReserved;
- CHAR8 FName[56];
+ CHAR8 FName[QEMU_FW_CFG_FNAME_SIZE];
FileSize = QemuFwCfgRead32 ();
FileSelect = QemuFwCfgRead16 ();