pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.87k stars 21.33k forks source link

Potential Divide By Zero Vulnerability in Darknet Project #2631

Open CR7-source opened 8 months ago

CR7-source commented 8 months ago

I have identified a potential divide by zero vulnerability in the Darknet project and would like to report it to the maintainers. This vulnerability has the potential to cause unexpected application behavior, crashes.Can you please help me check it? Thank you for your effort and patience! Below is the execution sequence of the program that may produce divide by zero vulnerability .

  1. darknet/src/detection_layer.c forward_detection_layer function:On line 73, the count variable is defined to be 0. On line 215, count is used as the divisor. Obviously count can be 0 if l.batch is 0, or the continue statement on line 94 is always executed in the loop

image