Skip to content

Potencial division by zero in turtle.py #157244

Description

@evdakim1234

Bug report

Bug description:

A static analysis tool reported several potential division by zero vulnerabilities in
Lib/turtle.py
value xspan can be 0

xspan = float(urx - llx)
self.xscale = self.canvwidth / xspan

Lib/turtle.py
value yspan can be 0

yspan = float(ury - lly)
self.yscale = self.canvheight / yspan

Lib/turtle.py
value steps can be 0

    steps = 1+int(min(11+abs(radius)/6.0, 59.0)*frac)
w = 1.0 * extent / steps

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions