- GOOSE subscriber: fixed crash when GOOSE messages misses time stamp

pull/244/head
Michael Zillgith 5 years ago
parent cdf371e92e
commit 994eea4b9a

@ -650,7 +650,15 @@ parseGoosePayload(GooseReceiver self, uint8_t* buffer, int apduLength)
matchingSubscriber->confRev = confRev;
matchingSubscriber->ndsCom = ndsCom;
matchingSubscriber->simulation = simulation;
if (timestampBufPos)
MmsValue_setUtcTimeByBuffer(matchingSubscriber->timestamp, timestampBufPos);
else {
if (DEBUG_GOOSE_SUBSCRIBER)
printf("GOOSE_SUBSCRIBER: GOOSE message has no time stamp\n");
MmsValue_setUtcTime(matchingSubscriber->timestamp, 0);
}
if (matchingSubscriber->dataSetValues == NULL)
matchingSubscriber->dataSetValues = parseAllDataUnknownValue(matchingSubscriber, dataSetBufferAddress, dataSetBufferLength, false);

@ -744,12 +744,14 @@ MmsValue_getUtcTimeQuality(const MmsValue* self)
void
MmsValue_setUtcTimeByBuffer(MmsValue* self, const uint8_t* buffer)
{
if (buffer) {
uint8_t* valueArray = self->value.utcTime;
int i;
for (i = 0; i < 8; i++) {
valueArray[i] = buffer[i];
}
}
}
uint8_t*

Loading…
Cancel
Save