Skip to content
Commit 6caf6964 authored by Ding Tao's avatar Ding Tao Committed by Anas Nashif
Browse files

net: pkt: Fix possible division by zero



When net debugging is enabled, the count variable is initialized to -1.
This may cause division by zero if there is only one fragment in pkt.
Solve this by setting the count to 0 and checking the value before the
print at the end of the function.

Successfully tested on STM32F407 SoC.

Signed-off-by: default avatarDing Tao <miyatsu@qq.com>
parent 21b94bac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment