Fix display of invalid resource forks

We were dumping various fields, but if the resource fork was too
short we were actually dumping uninitialized data.

Also, bumped version to 4.0.2-a1.
This commit is contained in:
Andy McFadden 2015-12-26 17:03:36 -08:00
parent 6bcf388c3e
commit ebef6a27c2
3 changed files with 10 additions and 10 deletions

View File

@ -4,8 +4,8 @@ faddenSoft
http://www.faddensoft.com/
CiderPress
http://a2ciderpress.com/
4.0.1
42240
4.0.2-a1
42364
C:\DATA\faddenSoft\fs.ico
Copyright © 2015 CiderPress project authors. All rights reserved.
C:\Src\CiderPress\DIST\ReadMe.txt
@ -355,7 +355,7 @@ FALSE
4095
Setup401.exe
Setup402a1.exe
FALSE

View File

@ -14,8 +14,8 @@
/* CiderPress version numbers */
#define kAppMajorVersion 4
#define kAppMinorVersion 0
#define kAppBugVersion 1
#define kAppDevString L""
#define kAppBugVersion 2
#define kAppDevString L"a1"
/*
* Windows application object.

View File

@ -79,6 +79,10 @@ int ReformatResourceFork::Process(const ReformatHolder* pHolder,
result = ReadHeader(srcBuf, srcLen, &rFileVersion, &rFileToMap,
&rFileMapSize, &littleEndian);
if (!result) {
BufPrintf("Does not appear to be a valid resource fork.\r\n");
goto done;
}
BufPrintf("Resource fork header (%s):\r\n",
littleEndian ? "Apple IIgs little-endian" : "Macintosh big-endian");
@ -93,10 +97,6 @@ int ReformatResourceFork::Process(const ReformatHolder* pHolder,
BufPrintf("Not an Apple IIgs resource fork (probably Macintosh).\r\n");
goto done;
}
if (!result) {
BufPrintf("Does not appear to be a valid resource fork.\r\n");
goto done;
}
/* move to start of resource map */
const uint8_t* mapPtr;
@ -169,7 +169,7 @@ done:
bool* pLittleEndian)
{
if (srcLen < 128) {
LOGI("ReformatResource: invalid len %d", srcLen);
LOGD("ReformatResource: invalid len %d", srcLen);
return false;
}