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
{{ message }}
Repository navigation
fix(foundation): _check_code(number=True) takes a bool, so register_tcp(True) adds port 1 #2269
Describe the bug _check_code lets any non-enum int through when number=True, and bool is an int subclass. So register_tcp, register_udp and register_sctp store True as key 1.
Reproduction (registries snapshotted and restored)
register_tcp(True, Raw) # no errorTCP.__proto__.get(1) # <class 'Raw'>, likewise UDP and SCTP
Expected behavior RegistryError: code must be an int or a member of AppType, not True, registry unchanged. Suggested fix: reject isinstance(code, bool) before the number branch in _check_code. This is separate from #2268, where the mapping form skips _check_code altogether.
System information
Linux, CPython 3.14.9, pcapkit 1.5.0b14, checkout main9d504ead5.
Activity
fix(foundation): reject a bool in _check_code(number=True) (#2269)
fix(foundation): reject a bool in _check_code(number=True) (#2269) (#…