Skip to content

Division by Zero #8

@shrezaei

Description

@shrezaei

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.?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions