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

Bad checksum passes FIXMessageDecoder validation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.3
    • Component/s: Message Generation
    • Labels:
      None
    • Environment:
      Java 6, Windows XP

      Description

      The FIXMessageDecoder.startsWith method has a bug, and the other functions in FIXMessageDecoder do not properly handle percolating the case back up to the caller. Specifically, if the pattern is matching against the end of a ByteBuffer it only matches the first character of the pattern. If the pattern doesn't match, there is no way to percolate a MessageDecoderResult.NOT_OK back up to the caller, it will just send back NEED_DATA.

      It is best illustrated by running the following JUnit test

      Paste into the FIXMessageDecoderTest class

      public void testPatternMatching() throws Exception

      { decoder = new FIXMessageDecoder("UTF-16"); setUpBuffer("8=FIX.4.2\0019=12\00135=X\001108=30\0011wmyadz"); MessageDecoderResult decoderResult = decoder.decode(null, buffer, decoderOutput); assertEquals("wrong decoder result", MessageDecoderResult.NOT_OK, decoderResult); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jwalters Jay Walters
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: