Uploaded image for project: 'EtherNet/IP Firmware V3'
  1. EtherNet/IP Firmware V3
  2. PSEISV3-418

Add parenthesis around all packet size definitions when they contain calculations

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V3.4.0.7, V3.4.2.0
    • Fix Version/s: V3.4.0.8, V3.4.3.0 , V3.5.0.0
    • Component/s: None
    • Labels:
      None
    • Account:
      SPC EthernetIp Slave (SPCETHERNE)

      Description

      For example:

      #define EIP_OBJECT_CIP_SERVICE_CNF_SIZE     (sizeof(EIP_OBJECT_CIP_SERVICE_CNF_T)) - EIP_OBJECT_MAX_PACKET_LEN

      Should be:

      #define EIP_OBJECT_CIP_SERVICE_CNF_SIZE     ((sizeof(EIP_OBJECT_CIP_SERVICE_CNF_T)) - EIP_OBJECT_MAX_PACKET_LEN)

      Because otherwise, a customer who writes an expression like:

      int ulDataLen = ptCnf->tHead.ulLen - EIP_OBJECT_CIP_SERVICE_CNF_SIZE;

      Runs into a really nasty underflow.

        Attachments

          Expenses

            Activity

              Status Description

                People

                • Reporter:
                  MBommert Marc Bommert
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: