Zero uninitialized icon group data for reproducible builds (bug #1230)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7104 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2019-07-31 19:59:55 +00:00
parent 9b5d7b9dfd
commit 8016f559ac
2 changed files with 6 additions and 3 deletions

View file

@ -28,6 +28,8 @@ ANSI targets are deprecated, consider moving to Unicode.
\b StrFunc.nsh now supports a "using" idiom to help with forward-declaration of functions (\W{http://sf.net/p/nsis/bugs/1229}{bug #1229})
\b Zero uninitialized data in icon group (\W{http://sf.net/p/nsis/bugs/1230}{bug #1230})
\S2{} Translations
\b Updated Hindi (\W{http://sf.net/p/nsis/patches/291}{patch #291}) and Portuguese (\W{http://sf.net/p/nsis/bugs/1219}{bug #1219})

View file

@ -272,10 +272,11 @@ static IconPairs get_icon_order(IconGroup icon1, IconGroup icon2)
#define destroy_icon_group(p) ( delete [] (p) )
static LPBYTE generate_icon_group(IconGroup icon, IconPairs order, bool first)
{
LPBYTE group = new BYTE[
size_t groupsize =
sizeof(IconGroupHeader) // header
+ order.size() * SIZEOF_RSRC_ICON_GROUP_ENTRY // entries
];
+ order.size() * SIZEOF_RSRC_ICON_GROUP_ENTRY; // entries
LPBYTE group = new BYTE[groupsize];
memset(group, 0, groupsize); // Reproducible builds (bug #1230)
IconGroupHeader* header = (IconGroupHeader*) group;