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
_missing_ in the four Mobility Header flag enums ends in return cls(value) — the same constructor that just failed to find the value. That re-enters _missing_, unbounded, so any value not already a member raises RecursionError instead of resolving or failing cleanly.
def_missing_(cls, value: 'int') ->'BindingACKFlag':
ifnot (isinstance(value, int) and0<=value<=0xFF):
raiseValueError('%r is not a valid %s'% (value, cls.__name__))
returncls(value)
The range guard is fine. The final line is the defect: for an in-range value that is not a member, cls(value) calls _missing_ again with the same argument.
Note these four are the odd ones out — none of them has an extend_enum fallback, which every other const/ module's _missing_ uses to mint a member for an unregistered value. So there is nothing to break the cycle.
Measured
On origin/main (af1f771b9), CPython 3.14.7, tree asserted against the repository rather than the editable install:
The reachable value is 0, not some exotic in-range bit pattern. The seven members are the single bits 2 through 128, so no flags set — the most ordinary value an eight-bit flag field can carry — is not a member and recurses.
That is a more available trigger than the "undefined in-range flag bit" framing this was first reported under. My own first probes, F(0x02) and F(0x04), returned normally because they happen to be defined; it took enumerating the members to find that zero is the hole.
Reachability
Not established, and I am not claiming it. The reporting worker said it is "real and pre-existing but not wire-reachable", and I have not traced whether a parsed Mobility Header can present a zero flags octet to one of these four classes. Given 0 is the value at issue, that trace is worth doing before deciding the severity: a flags field with no bits set is not an unusual thing to appear on a wire.
If it is reachable, a RecursionError from library code on ordinary input is considerably worse than the ValueError the guard above it produces for out-of-range values.
_missing_in the four Mobility Header flag enums ends inreturn cls(value)— the same constructor that just failed to find the value. That re-enters_missing_, unbounded, so any value not already a member raisesRecursionErrorinstead of resolving or failing cleanly.The four modules
All four carry the identical body:
The range guard is fine. The final line is the defect: for an in-range value that is not a member,
cls(value)calls_missing_again with the same argument.Note these four are the odd ones out — none of them has an
extend_enumfallback, which every otherconst/module's_missing_uses to mint a member for an unregistered value. So there is nothing to break the cycle.Measured
On
origin/main(af1f771b9), CPython 3.14.7, tree asserted against the repository rather than the editable install:The reachable value is
0, not some exotic in-range bit pattern. The seven members are the single bits 2 through 128, so no flags set — the most ordinary value an eight-bit flag field can carry — is not a member and recurses.That is a more available trigger than the "undefined in-range flag bit" framing this was first reported under. My own first probes,
F(0x02)andF(0x04), returned normally because they happen to be defined; it took enumerating the members to find that zero is the hole.Reachability
Not established, and I am not claiming it. The reporting worker said it is "real and pre-existing but not wire-reachable", and I have not traced whether a parsed Mobility Header can present a zero flags octet to one of these four classes. Given
0is the value at issue, that trace is worth doing before deciding the severity: a flags field with no bits set is not an unusual thing to appear on a wire.If it is reachable, a
RecursionErrorfrom library code on ordinary input is considerably worse than theValueErrorthe guard above it produces for out-of-range values.Notes
python -m pcapkit.vendorrun.get()integer path), which fix(const): normalise the key get() looks up, and honour its documented default (#582, #583, #584) #596 fixed across 114const/files. This is_missing_rather thanget(), and fix(const): normalise the key get() looks up, and honour its documented default (#582, #583, #584) #596 did not touch it.