From a86829a27e651bc1e9d626c99f5ada76ce2d6b93 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Wed, 9 Oct 2013 08:55:54 +0200 Subject: [PATCH] Version 0.2.3 Minor possible errors correction --- Tiano/EfiCompress.c | 3 +++ uefitool.cpp | 4 +++- uefitool.pro | 3 ++- uefitool.ui | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tiano/EfiCompress.c b/Tiano/EfiCompress.c index ab8f06f..1437c05 100644 --- a/Tiano/EfiCompress.c +++ b/Tiano/EfiCompress.c @@ -416,6 +416,9 @@ Returns: UINT32 i; mText = malloc (WNDSIZ * 2 + MAXMATCH); + if (!mText) + return ERR_OUT_OF_MEMORY; + for (i = 0 ; i < WNDSIZ * 2 + MAXMATCH; i ++) { mText[i] = 0; } diff --git a/uefitool.cpp b/uefitool.cpp index 6f84573..3cb3cf7 100644 --- a/uefitool.cpp +++ b/uefitool.cpp @@ -289,7 +289,7 @@ UINT8* UEFITool::parseRegion(const QByteArray & flashImage, UINT8 regionSubtype, UINT32 regionSize = calculateRegionSize(regionBase, regionLimit); // Populate descriptor map - FLASH_DESCRIPTOR_MAP* descriptor_map = (FLASH_DESCRIPTOR_MAP*) flashImage.constData() + sizeof(FLASH_DESCRIPTOR_HEADER); + FLASH_DESCRIPTOR_MAP* descriptor_map = (FLASH_DESCRIPTOR_MAP*) (flashImage.constData() + sizeof(FLASH_DESCRIPTOR_HEADER)); // Determine presence of 2 flash chips bool twoChips = descriptor_map->NumberOfFlashChips; @@ -809,7 +809,9 @@ UINT8 UEFITool::parseFile(const QByteArray & file, UINT8 revision, bool erasePol if (LzmaGetInfo(data, dataSize, &decompressedSize) != ERR_SUCCESS) debug(tr("LzmaGetInfo failed")); } + decompressed = new UINT8[decompressedSize]; + // Decompress section data if (LzmaDecompress(data, dataSize, decompressed) != ERR_SUCCESS) debug(tr("LzmaDecompress failed")); diff --git a/uefitool.pro b/uefitool.pro index 7a60b4b..3a95d2f 100644 --- a/uefitool.pro +++ b/uefitool.pro @@ -22,7 +22,8 @@ HEADERS += uefitool.h \ basetypes.h \ descriptor.h \ ffs.h \ - treeitem.h \ + treeitem.h \ + treeitemtypes.h \ treemodel.h \ LZMA/LzmaCompress.h \ LZMA/LzmaDecompress.h \ diff --git a/uefitool.ui b/uefitool.ui index 5444e93..74f684d 100644 --- a/uefitool.ui +++ b/uefitool.ui @@ -20,7 +20,7 @@ true - UEFITool 0.2.2 + UEFITool 0.2.3