From 66e585c40883326d40dc6073bca4f4a867438be5 Mon Sep 17 00:00:00 2001 From: BiffoBear Date: Wed, 26 Oct 2022 05:46:59 +0300 Subject: [PATCH] Fixed buffer overrun in adafruit_wiznet5k_dhcp.send_dhcp_message --- adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py b/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py index f66b502..1a4f9dd 100644 --- a/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py +++ b/adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py @@ -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