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

Potential null pointer in DataDictionary.isMsgField

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.1
    • Component/s: Metadata/Specs
    • Labels:
      None

      Description

      isMsgField uses single & after a null check - since & doesn't short circuit it throws null pointer if fields is null.

      Change from:

      public boolean isMsgField(String msgType, int field)

      { Set fields = (Set) messageFields.get(msgType); return fields != null & fields.contains(new Integer(field)); }

      to

      public boolean isMsgField(String msgType, int field)

      { Set fields = (Set) messageFields.get(msgType); return fields != null && fields.contains(new Integer(field)); }

      Unit test - add the following to DataDictionaryTest.testDictionary()

      assertFalse(dd.isMsgField("UNKNOWN_TYPE", 1));

        Attachments

          Activity

            People

            • Assignee:
              admin Steve Bate
              Reporter:
              bradh Brad Harvey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: