Skip to content

Commit aac23ef

Browse files
committed
net: lwm2m: fix json NULL deref / code flow in read_number()
Per Coverity report, we are assigning the value1 and value2 s64_t pointers a value of 0. Later when we go to use value1 and value2, they are of course ... NULL. Fix the typos in the initial assignment of 0 to the references of value1 and value2. Fixes: zephyrproject-rtos#13867 Fixes: zephyrproject-rtos#13882 Signed-off-by: Michael Scott <[email protected]>
1 parent d30c9ae commit aac23ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/lib/lwm2m/lwm2m_rw_json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ static size_t read_number(struct lwm2m_input_context *in,
540540
char c;
541541

542542
/* initialize values to 0 */
543-
value1 = 0;
543+
*value1 = 0;
544544
if (value2) {
545-
value2 = 0;
545+
*value2 = 0;
546546
}
547547

548548
fd = engine_get_in_user_data(in);

0 commit comments

Comments
 (0)