Ab.Transport: CIP codec hardening (bounds, path casts, immutable constants) #564
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context: native .NET Allen-Bradley transport work (plan
docs/plans/2026-10-07-native-ab-transport.md, branchfeat/native-ab-transport, not yet merged). Parked as a Minor during per-task review — none of these block the plan.Hardening items in the
Ab.TransportCIP codec layer (src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport/Cip,Wire):CipWriter.PatchU16has no bounds guard.CipReply.ExtendedStatususes array reference equality (record equality overbyte[]).FromCip(0xFF, empty)mapping is untested.CipPath: unchecked length/port casts;WithPathSizedoes not reject odd/oversize paths.ArgumentException.MessageRouter/ConnectionManagerexpose public mutablebyte[]constants — make themReadOnlySpan<byte>/ImmutableArray.CaptureFilestill usesBitConverter(endianness-implicit).Fixed all items: PatchU16 bounds guard, content-equal CipReply, FromCip(0xFF, empty) test, CipPath port/length/ASCII/odd-size validation, malformed tag names → ArgumentException, MessageRouter/ConnectionManager as ReadOnlySpan, ForwardOpenRefusedException with structured General/Extended status, CaptureFile on BinaryPrimitives. (merge
13a67270on master, pushed 2026-10-08)