[ablegacy] AbLegacy — ST string verification + length guard #353
Reference in New Issue
Block a user
Delete Branch "auto/ablegacy/6"
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?
Summary
Verifies libplctag's
GetString/SetStringround-trips ST-file strings (1-word length prefix + 82 ASCII bytes) and adds a client-side length guard.LibplctagLegacyTagRuntime.EncodeValue— throwsArgumentOutOfRangeExceptionforStringwrites > 82 chars (newStFileMaxStringLengthconstant).AbLegacyDriver.WriteAsync— siblingcatch (ArgumentOutOfRangeException) → BadOutOfRangeclause so the OPC UA client gets a clean rejection instead of a silent libplctag truncation.Test plan
dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy— clean (0 / 0)dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests— 312 / 312 passed (16 new inAbLegacyStringEncodingTests: empty / 41-char / 82-char-boundary / embedded-NUL / non-ASCII reads and writes for both Slc500 and Plc5 families; theory cases verifying >82-char writes returnBadOutOfRangeand never reachWriteAsync)🤖 Auto-generated by the Mode-B execution loop. Closes #249.
Closes #249