Skip to content

Fixed buffer overrun in adafruit_wiznet5k_dhcp.send_dhcp_message (non breaking) #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

BiffoBear
Copy link
Contributor

closes #68 Check length of MAC address is 6 bytes in DHCP.__init__()

    def __init__(
        self, eth, mac_address, hostname=None, response_timeout=30, debug=False
        ...
                # Prevent buffer overrun in send_dhcp_message()
        if len(mac_address) != 6:
            raise ValueError("The MAC address must be 6 bytes.")
        self._mac_address = mac_address

N.B. I don't have hardware to test this.

Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the fix!

@tekktrik tekktrik merged commit c1ceb98 into adafruit:main Oct 27, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 27, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_STMPE610 to 1.3.9 from 1.3.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_STMPE610#26 from rtwfroody/typeerror

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.12.13 from 1.12.12:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#69 from BiffoBear/bug_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.12.9 from 1.12.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#117 from gustavomfb/116-Fix_header_annotation
@BiffoBear BiffoBear deleted the bug_fix branch January 17, 2023 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buffer overrun if a MAC address longer than 6 bytes is used.
2 participants