net: lwm2m: Initialize CoAP response on bootstrap finish

During the bootstrap procedure, when Boostrap Finish was received, the
response message was not initialized properly, resulting in a socket
error (NULL pointer porovided) and the response not being sent.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-07-15 14:32:51 +02:00 committed by Anas Nashif
commit 00d12041f6

View file

@ -3353,6 +3353,12 @@ static int handle_request(struct coap_packet *request,
} else if ((code & COAP_REQUEST_MASK) == COAP_METHOD_POST && r == 1 && \
strncmp(options[0].value, "bs", options[0].len) == 0) {
engine_bootstrap_finish();
r = lwm2m_init_message(msg);
if (r < 0) {
goto error;
}
return 0;
#endif
} else {