Skip to content

Commit

Permalink
Merge pull request #69 from BiffoBear/bug_fix
Browse files Browse the repository at this point in the history
Fixed buffer overrun in adafruit_wiznet5k_dhcp.send_dhcp_message (non breaking)
  • Loading branch information
tekktrik authored Oct 27, 2022
2 parents 5f501fd + 66e585c commit c1ceb98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def __init__(
):
self._debug = debug
self._response_timeout = response_timeout

# 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

# Set socket interface
Expand Down

0 comments on commit c1ceb98

Please sign in to comment.