diff mbox series

[2/3] ebg: detailed logging if malloc fails

Message ID 20230816092424.203252-3-michael.adler@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series Regarding efibootguard CVE-2023-39950 | expand

Commit Message

Michael Adler Aug. 16, 2023, 9:24 a.m. UTC
If allocating memory fails, log the requested memory size and the key
name. This helps in diagnosing problems.

Signed-off-by: Michael Adler <michael.adler@siemens.com>
Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 bootloader/ebg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bootloader/ebg.c b/bootloader/ebg.c
index ce7e03a..76a1e28 100644
--- a/bootloader/ebg.c
+++ b/bootloader/ebg.c
@@ -121,7 +121,7 @@  static char *_env_get(const char *name)
 
 	char *value = malloc(size);
 	if (value == NULL) {
-		ERROR("Error allocating memory");
+		ERROR("Error allocating %d bytes of memory to get '%s'", size, name);
 		return NULL;
 	}