You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# layers/dhcp.py:192defgetfield(self, pkt, s):
ifnots:
returnNoneprefix=orb(s[0])
# if prefix is invalid value ( 0 > prefix > 32 ) then breakifprefix>32orprefix<0:
warning("Invalid prefix value: %d (0x%x)", prefix, prefix)
returns, []
route_len=5+ (prefix+7) //8returns[route_len:], self.m2i(pkt, s[:route_len])
and it returns in line 200 with s, [] which causes the same data going in again and again endlessly.
each iteration val gets appended with another [] so it looks like [[], [], [], [], [], [], ......, []]
i think you should raise excepion in line 200 instead of return s, []
The text was updated successfully, but these errors were encountered:
when running a malformed DHCP packet with
DHCP(data)
- scapy runs endlessly and increasing memory consumption.The mechanism is this partial code runs getfield() (in layers/dhcp.py:457) which runa
where dhcp's getfield is:
and it returns in line 200 with
s, []
which causes the same data going in again and again endlessly.each iteration val gets appended with another [] so it looks like
[[], [], [], [], [], [], ......, []]
i think you should raise excepion in line 200 instead of
return s, []
The text was updated successfully, but these errors were encountered: