1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-22 18:15:25 +01:00

libpinproc: fixed uninitialized memory that could cause memory consumption leading to a crash.

pypinproc: changed linker path to point to ../bin.  Added note about running in 64-bit environment (Snow Leopard).
pyprocgame: debug printing enhancements
jdtest: Fixed bug (not clearing out drop target mode).  Added initial Splash.dmd.
This commit is contained in:
Adam Preble
2009-09-21 23:12:41 -04:00
parent d8006b3029
commit 5dbe3e696f
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
bin/
build/
*/*.pbxuser
*/*.perspectivev3

View File

@@ -86,10 +86,11 @@ PRResult PRDevice::Reset(uint32_t resetFlags)
// Make sure the free list is empty.
while (!freeSwitchRuleIndexes.empty()) freeSwitchRuleIndexes.pop();
memset(switchRules, 0x00, sizeof(PRSwitchRuleInternal) * maxSwitchRules);
for (i = 0; i < kPRSwitchRulesCount; i++)
{
PRSwitchRuleInternal *switchRule = &switchRules[i];
memset(switchRule, 0x00, sizeof(PRSwitchRule));
uint16_t ruleIndex = i;
ParseSwitchRuleIndex(ruleIndex, &switchRule->switchNum, &switchRule->eventType);
@@ -454,6 +455,12 @@ PRResult PRDevice::SwitchUpdateRule(uint8_t switchNum, PREventType eventType, PR
{
oldRule = GetSwitchRuleByIndex(oldRule->linkIndex);
freeSwitchRuleIndexes.push(oldRule->linkIndex);
if (freeSwitchRuleIndexes.size() > 128) // Detect a corrupted link-related values before it eats up all of the memory.
{
PRSetLastErrorText("Too many free switch rule indicies!");
return kPRFailure;
}
}
// Now let's setup the first actual rule: