From 5691c3f3ffecacc80533d90e4b9a04c8eb047b0a Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 10 Mar 2006 21:42:06 +0000 Subject: [PATCH] the conditions on both wIsIcon and wReserved must be met, not just on one of them git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4563 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/util.cpp b/Source/util.cpp index 5ad94918..b514495a 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -143,7 +143,7 @@ void replace_icon(CResourceEditor* re, WORD wIconId, const char* filename) IconGroupHeader igh; if (!fread(&igh, sizeof(IconGroupHeader), 1, f)) throw runtime_error("unable to read file"); - if (igh.wIsIcon != 1 && igh.wReserved != 0) throw runtime_error("invalid icon file"); + if (igh.wIsIcon != 1 || igh.wReserved != 0) throw runtime_error("invalid icon file"); BYTE* rsrcIconGroup = (BYTE*)malloc(sizeof(IconGroupHeader) + igh.wCount*SIZEOF_RSRC_ICON_GROUP_ENTRY); if (!rsrcIconGroup) throw bad_alloc(); @@ -211,7 +211,7 @@ unsigned char* generate_uninstall_icon_data(const char* filename, size_t &size) IconGroupHeader igh; if (!fread(&igh, sizeof(IconGroupHeader), 1, f)) throw runtime_error("unable to read file"); - if (igh.wIsIcon != 1 && igh.wReserved != 0) throw runtime_error("invalid icon file"); + if (igh.wIsIcon != 1 || igh.wReserved != 0) throw runtime_error("invalid icon file"); int iNewIconSize = 0; FileIconGroupEntry ige;