mirror of
https://github.com/eblot/pybootd.git
synced 2024-08-17 18:00:33 +03:00
Should address #13: infinite padding decoding loop
This commit is contained in:
parent
9992ae524b
commit
3c9603ab5d
@ -287,11 +287,16 @@ class BootpServer:
|
||||
def parse_options(self, tail):
|
||||
self.log.debug('Parsing DHCP options')
|
||||
dhcp_tags = {}
|
||||
padding_count = 0
|
||||
while tail:
|
||||
tag = tail[0]
|
||||
# padding
|
||||
if tag == 0:
|
||||
padding_count += 1
|
||||
if padding_count > 255:
|
||||
raise ValueError('Padding overflow')
|
||||
continue
|
||||
padding_count = 0
|
||||
if tag == 0xff:
|
||||
return dhcp_tags
|
||||
length = tail[1]
|
||||
|
Loading…
Reference in New Issue
Block a user