partcl icon indicating copy to clipboard operation
partcl copied to clipboard

Division by Zero

Open shrezaei opened this issue 6 years ago • 0 comments

After second round of fuzzing, I realized that you do not check division by zero. It is in tcl_cmd_math() function. You can simply add an if statement and solve the problem. Additionally, I suggest that you check arguments of math operation before passing it to tcl_int(). Because you used atoi() function in tcl_int() and it basically convert the digits from the beginning of the string until it reaches any non-digit character. That means, you can pass "22sdfe" (which gives 22) or even "sdfdsf" (which gives 0) and it will work. But, it is better to show an error ("?!" string in your app) to let the user know that.?!

shrezaei avatar Oct 26 '18 00:10 shrezaei