1
0
Fork 0

Fix dereference before NULL check (#585)

You are right, thank you.
This commit is contained in:
Cory Van Beek 2025-07-15 07:00:55 -06:00 committed by GitHub
parent 6dfd4ed7f2
commit c7a4d26b38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,7 +75,10 @@ static CO_ReturnError_t CO_HBconsumer_initEntry(CO_HBconsumer_t* HBcons, uint8_t
*/
static ODR_t
OD_write_1016(OD_stream_t* stream, const void* buf, OD_size_t count, OD_size_t* countWritten) {
CO_HBconsumer_t* HBcons = stream->object;
CO_HBconsumer_t* HBcons;
if (stream != NULL) {
HBcons = stream->object;
}
if ((stream == NULL) || (buf == NULL) || (stream->subIndex < 1U)
|| (stream->subIndex > HBcons->numberOfMonitoredNodes) || (count != sizeof(uint32_t))