Skip to content

Commit 695466c

Browse files
Peter Tönzmlasch
authored andcommitted
[sg fromtree] net: lwm2m: Fix buffer overflow by using CONFIG_LWM2M_VERSION_1_0
By using CONFIG_LWM2M_VERSION_1_0, the function lwm2m_engine_get_binding() returns the binding and the queue mode bytes. Therefore the buffer must be tree bytes long. The issue is caused by the two inconsistent defines: lwm2m_registry.c: #define BINDING_OPT_MAX_LEN 3 /* "UQ" */ lwm2m_rd_client.c: #define CLIENT_BINDING_LEN sizeof("U") Signed-off-by: Peter Tönz <[email protected]> (cherry picked from commit a868da8)
1 parent 3541f15 commit 695466c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/lwm2m/lwm2m_rd_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
6969

7070
#define CLIENT_EP_LEN CONFIG_LWM2M_RD_CLIENT_ENDPOINT_NAME_MAX_LENGTH
7171

72-
#define CLIENT_BINDING_LEN sizeof("U")
72+
#define CLIENT_BINDING_LEN sizeof("UQ")
7373
#define CLIENT_QUEUE_LEN sizeof("Q")
7474

7575
static void sm_handle_registration_update_failure(void);

0 commit comments

Comments
 (0)