Broadcom-Network-Switching-Software / OpenBCM

154 stars 76 forks source link

COVERITY DIVIDE_BY_ZERO - address_granularity could be 0 in the division operation #14

Open shao-liancheng opened 3 years ago

shao-liancheng commented 3 years ago

https://github.com/Broadcom-Network-Switching-Software/OpenBCM/blob/9f1c364424ac8d8c287fb3b5d3e173c99dfdccc4/sdk-6.5.21/src/bcm/dnx/algo/lif_mngr/local_outlif_allocation.c#L1105

http://cov-lvn-28.lvn.broadcom.net:8080/doc/en/cov_checker_ref.html#static_checker_DIVIDE_BY_ZERO

shao-liancheng commented 3 years ago

assert(address_granularity != 0) should be used before the division operation