[PATCH] uefi: uefidump: handle realloc failure

Colin King colin.king at canonical.com
Fri Mar 9 01:13:39 UTC 2012


From: Colin Ian King <colin.king at canonical.com>

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/uefi/uefidump/uefidump.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index a08b629..1f71107 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -50,6 +50,8 @@ static char *uefidump_vprintf(char *str, const char *fmt, ...)
 		str = strdup(buffer);
 	else {
 		str = realloc(str, strlen(str) + strlen(buffer) + 1);
+		if (str == NULL)
+			return NULL;
 		strcat(str, buffer);
 	}
 
-- 
1.7.9





More information about the fwts-devel mailing list