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: https://github.com/zephyrproject-rtos/zephyr/issues/12317 Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/12320 Signed-off-by: Michael Scott <mike@foundries.io>
This commit is contained in:
parent
c73dc42a82
commit
95f21d59b7
1 changed files with 2 additions and 2 deletions
|
@ -848,7 +848,7 @@ static int atof32(const char *input, float32_value_t *out)
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
val = strtol(buf, &end, 10);
|
val = strtol(buf, &end, 10);
|
||||||
if (errno || *end || val > INT_MAX || val < INT_MIN) {
|
if (errno || *end || val < INT_MIN) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2394,7 +2394,7 @@ static int lwm2m_write_attr_handler(struct lwm2m_engine_obj *obj,
|
||||||
*/
|
*/
|
||||||
errno = 0;
|
errno = 0;
|
||||||
v = strtol(opt_buf, &end, 10);
|
v = strtol(opt_buf, &end, 10);
|
||||||
if (errno || *end || v > INT_MAX || v < 0) {
|
if (errno || *end || v < 0) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue