pnp-software / cordetfw

C Implementation of a Software Framework for Service-Oriented Applications with PUS Support
Mozilla Public License 2.0
13 stars 1 forks source link

InCmp Released Too Early in CrFwInLoader #110

Closed pasetti closed 6 years ago

pasetti commented 6 years ago

Christian has detected an error in CrFwInLoader. In some cases, we have code as follows:

    if (FwSmGetCurState(inCmp) != CR_FW_BASE_STATE_CONFIGURED) {    /* InRep/InCmd has failed its validity check */
        inCmpData = FwSmGetData(inCmp);
        if (cmdRepFlag == crRepType) {
            CrFwInFactoryReleaseInRep(inCmp);
            CrFwRepErrRep(crInLoaderAccFail, inLoaderData.typeId,inLoaderData.instanceId, inCmp);
            return;
        } else {
            CrFwInFactoryReleaseInCmd(inCmp);
            CrFwRepInCmdOutcome(crCmdAckAccFail, instanceId, servType, servSubType, disc, inCmpData->outcome, inCmp);
            return;
        }
    }

This is wrong because the InCmp is released before it is used in the call to CrFwRepErrRep.

pasetti commented 6 years ago

Bug fixed in release 0.9.3