wakaama icon indicating copy to clipboard operation
wakaama copied to clipboard

observe_step() in observe.c does not check a return parameter of pointer type.

Open stefanfangvall opened this issue 4 years ago • 2 comments

check (dataP == NULL): dataP can be NULL even if object_readData() returns COAP_205_CONTENT

void observe_step(lwm2m_context_t * contextP, time_t currentTime, time_t * timeoutP) { lwm2m_data_t * dataP = NULL . . if (COAP_205_CONTENT != object_readData(contextP, &targetP->uri, &size, &dataP)) continue;

stefanfangvall avatar Nov 23 '20 09:11 stefanfangvall

This would only happen when observing at the object level with no instances of the object. It appears to be an issue wherever object_readData() is called.

sbertin-telular avatar Nov 30 '20 13:11 sbertin-telular

@sbertin-telular you made a clarifying comment, thanks. Can you elaborate a bit more? Does this require a programming error e.g. on the implementation of the targetP->readFunc for a not yet implemented object or is this an existing issue that can be shown to exist?

qleisan avatar Feb 17 '21 09:02 qleisan