Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-278

method extractField(Group group, DataDictionary dataDictionary, FieldMap fields) don't check The length of "sohOffset"

    Details

    • Type: Bug
    • Status: Open
    • Priority: Default
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: Future Releases
    • Component/s: Engine
    • Labels:
      None

      Description

      In the class Message, method extractField(Group group, DataDictionary dataDictionary, FieldMap fields): The length of "sohOffset" is not checked. This will bring about full range of the message received as Message string out of range.

      For all the field, if it is dataField, its length must be calculated by the former Field(Except for Tag 89/93). Because the data may contain a SOH.
      For example, field 355 is dataField. Its length is in Field 354.
      We must check the offset of the dataField is shorter than length of the message, and the offset's next char is SOH.

      Add this code into Message.extractField():

      //Judge if sohOffset's next char is '\001'.
      if(messageData.indexOf('\001', sohOffset) != sohOffset)
      throw new InvalidMessage("Wrong length of data field.");
      //Judge if sohOffset is shorter than fields.
      if(sohOffset > messageData.length())
      throw new InvalidMessage("Wrong length of data field.");

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              caiqi CaiQi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: