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

View File

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

View File

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