srv 20 fixes

This commit is contained in:
Robin Müller 2021-06-13 17:58:44 +02:00
parent 8dc66784a8
commit 40a8c9a495
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 6 additions and 4 deletions

View File

@ -133,6 +133,9 @@ ReturnValue_t Service20ParameterManagement::prepareLoadCommand(
store_address_t storeAddress;
size_t parameterDataLen = tcDataLen - sizeof(object_id_t) - sizeof(ParameterId_t) -
sizeof(uint32_t);
if(parameterDataLen == 0) {
return CommandingServiceBase::INVALID_TC;
}
ReturnValue_t result = IPCStore->getFreeElement(&storeAddress,
parameterDataLen, &storePointer);
if(result != HasReturnvaluesIF::RETURN_OK) {

View File

@ -27,12 +27,11 @@ public:
ParameterCommand(uint8_t* storePointer, size_t parameterDataLen):
parameterBuffer(storePointer, parameterDataLen) {
#if FSFW_VERBOSE_LEVEL >= 1
if(parameterDataLen < sizeof(object_id_t) + sizeof(ParameterId_t) + 4) {
if(parameterDataLen == 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ParameterCommand: Parameter data length is less than 12!"
<< std::endl;
sif::warning << "ParameterCommand: Parameter data length is 0" << std::endl;
#else
sif::printWarning("ParameterCommand: Parameter data length is less than 12!\n");
sif::printWarning("ParameterCommand: Parameter data length is 0!\n");
#endif
}
#endif /* FSFW_VERBOSE_LEVEL >= 1 */