Skip to content

Commit 844c2ad

Browse files
mike-scottnashif
authored andcommitted
net: lwm2m: fix NULL deref in plain_text_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: #12300 Fixes: #12296 Signed-off-by: Michael Scott <[email protected]>
1 parent f6b2216 commit 844c2ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/lib/lwm2m/lwm2m_rw_plain_text.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ static size_t plain_text_read_number(struct lwm2m_input_context *in,
176176
u8_t tmp;
177177

178178
/* initialize values to 0 */
179-
value1 = 0;
179+
*value1 = 0;
180180
if (value2) {
181-
value2 = 0;
181+
*value2 = 0;
182182
}
183183

184184
while (in->offset < in->in_cpkt->offset) {

0 commit comments

Comments
 (0)