Skip to content
Commit 36d6a725 authored by Seppo Takalo's avatar Seppo Takalo Committed by Carles Cufí
Browse files

net: lwm2m: Count null-terminator in string size



As the lwm2m_registry.c and specificly lwm2m_set()
functions already ensure null-terminator on string and
count that into string lenght, the content type handlers
should do the same.

When string is written, strlen()+1 is the data length.
When string is read, use the data length, so we don't
leak uninitialized strings. If buffer overrun have
removed the null-terminator the strlen() migh be larger
than data_len.

Signed-off-by: default avatarSeppo Takalo <seppo.takalo@nordicsemi.no>
parent e5e599c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment