Skip to content

Commit

Permalink
- fixed - GOOSE subscriber is not processing octet string when longer…
Browse files Browse the repository at this point in the history
… than the one received at first time (LIB61850-232)
  • Loading branch information
mzillgith committed Mar 11, 2022
1 parent 77e8144 commit 210cf30
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/goose/goose_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,22 @@ parseAllData(uint8_t* buffer, int allDataLength, MmsValue* dataSetValues)
value->value.octetString.size = elementLength;
memcpy(value->value.octetString.buf, buffer + bufPos, elementLength);
}
else {
uint8_t* newBuf = (uint8_t*)GLOBAL_MALLOC(elementLength);

if (newBuf) {
memcpy(newBuf, buffer + bufPos, elementLength);

uint8_t* oldBuf = value->value.octetString.buf;

value->value.octetString.buf = newBuf;
value->value.octetString.maxSize = elementLength;
value->value.octetString.size = elementLength;

GLOBAL_FREEMEM(oldBuf);
}

}
}
else {
pe = GOOSE_PARSE_ERROR_TYPE_MISMATCH;
Expand Down

0 comments on commit 210cf30

Please sign in to comment.