net: lib: lwm2m: Fix expected block calculation
Coverity reported that a formula used to calculate the next expected block in case the block size from the request differs our own block size has a bug. The expression used to calculate the block size diff would evaluate to an unsigned integer, giving (wrongly) enormous results in case block size from the request is smaller than the Zephyr's default. It turns out however, that this formula is no longer needed at all. Since commit d3081e2f, Zephyr's LwM2M implementation will no longer negotiate the block size in case of write operation, but simply comply with the block size included in the request. This means that calculating the diff makes no longer sense and can be safely removed - the next expected block number should be simply increased by 1. Signed-off-by:Robert Lubos <robert.lubos@nordicsemi.no>
Loading
Please sign in to comment