Skip to content

det port: LINK COMMAREA(ERROR-MSG) to LGSTSQ marshals past the 71-byte record (GenApp error paths) #4181

Closed

Description

@squid-protocol

Problem

In the det port of GenApp LGACDB01, EXEC CICS LINK PROGRAM('LGSTSQ') COMMAREA(ERROR-MSG) passes a 71-byte record. The LINK is marshalled with CA-ERROR-MSG's DTO, which is wider, and fails reading past the record:

StringIndexOutOfBoundsException: offset 9, count 90, length 71

This is on GenApp's SQL error paths (WRITE-ERROR-MESSAGE then LINK LGSTSQ). None of our proofs reach those paths, because the harness has no SQL fault injection (#4173). Agent H's run of IBM's LGACDB01 Java (#4177) forced the error path and exposed it; it used a --clamp-error-msg workaround in its scratch copy only.

Expected

A LINK COMMAREA is marshalled with the layout of the area actually passed (ERROR-MSG, 71 bytes), or the length the caller passes, per the LINK typing rules (target_contract / VALUE). It must never read past the record.

Notes

  • Probably affects every GenApp program that LINKs LGSTSQ with its ERROR-MSG, and any LINK whose COMMAREA is narrower than the callee's declared DTO.
  • Add a proof that reaches it once equivalence: SQL fault injection (register M2) so SQLCODE error branches are proven #4173 lands. Until then, add a translator unit test with a narrower COMMAREA.
  • LGSTSQ itself is refused by the harness (register X6, WRITEQ past FROM), so the end-to-end proof needs that limit too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    era:2scope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions