Skip to content

Commit 95f21d5

Browse files
mike-scottnashif
authored andcommitted
net: lwm2m: remove checks for long int > MAX_INT
Per Coverity report, the evaluation of long int v > MAX_INT is always false and considered a CONSTANT_EXPRESS_RESULT issue. Removed these checks from: atof32() lwm2m_write_attr_handler() Fixes: #12317 Fixes: #12320 Signed-off-by: Michael Scott <[email protected]>
1 parent c73dc42 commit 95f21d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/lib/lwm2m/lwm2m_engine.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static int atof32(const char *input, float32_value_t *out)
848848

849849
errno = 0;
850850
val = strtol(buf, &end, 10);
851-
if (errno || *end || val > INT_MAX || val < INT_MIN) {
851+
if (errno || *end || val < INT_MIN) {
852852
return -EINVAL;
853853
}
854854

@@ -2394,7 +2394,7 @@ static int lwm2m_write_attr_handler(struct lwm2m_engine_obj *obj,
23942394
*/
23952395
errno = 0;
23962396
v = strtol(opt_buf, &end, 10);
2397-
if (errno || *end || v > INT_MAX || v < 0) {
2397+
if (errno || *end || v < 0) {
23982398
ret = -EINVAL;
23992399
}
24002400

0 commit comments

Comments
 (0)