another 30 or so bytes saved, by modifying readSelfFile to do all length checking. Not sure if I broke anything though =)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1179 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0728c9b4c8
commit
997ff07df8
4 changed files with 31 additions and 30 deletions
|
@ -164,7 +164,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
static char temp[512];
|
||||
DWORD l=left;
|
||||
if (l > 512) l=512;
|
||||
if (!ReadSelfFile(temp,l,&l))
|
||||
if (!ReadSelfFile(temp,l))
|
||||
{
|
||||
m_Err=_LANG_INVALIDCRC;
|
||||
#if defined(NSIS_CONFIG_CRC_SUPPORT) && defined(NSIS_CONFIG_VISIBLE_SUPPORT)
|
||||
|
@ -254,10 +254,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
#ifdef NSIS_CONFIG_CRC_SUPPORT
|
||||
if (do_crc)
|
||||
{
|
||||
DWORD l;
|
||||
int fcrc;
|
||||
SetSelfFilePointer(m_pos,FILE_BEGIN);
|
||||
if (!ReadSelfFile(&fcrc,4,&l) || crc != fcrc)
|
||||
if (!ReadSelfFile(&fcrc,4) || crc != fcrc)
|
||||
{
|
||||
m_Err=_LANG_INVALIDCRC;
|
||||
goto end;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue