From patchwork Fri Mar 9 01:13:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 145641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1AC6CB6F98 for ; Fri, 9 Mar 2012 12:13:43 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1S5oOr-0000oi-V3 for incoming@patchwork.ozlabs.org; Fri, 09 Mar 2012 01:13:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1S5oOq-0000od-Q3 for fwts-devel@lists.ubuntu.com; Fri, 09 Mar 2012 01:13:40 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S5oOq-0007Uh-LS for fwts-devel@lists.ubuntu.com; Fri, 09 Mar 2012 01:13:40 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefi: uefidump: handle realloc failure Date: Fri, 9 Mar 2012 01:13:39 +0000 Message-Id: <1331255619-31407-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.9 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- 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); }