#16 Parsing group data when delimiter field is not present

pending-accepted
nobody
None
5
2012-02-28
2011-12-06
No

There is a problem with existing quickfix code when we encounter a message where group delimiter field is not present - this leads to situation where we are still able to extract field information but cannot query properly group data because ALL field entries we stored in the one a only instance of the Group class:

The fix is in Message.cpp, Message::setGroup() method. If delimiter field is not present but we have extracted the field which is already set for current Group object - we should create a new Group because this will lead to the bug described earlier.

std::string::size_type oldPos = pos;
FieldBase field = extractField( string, pos, &dataDictionary, &dataDictionary, pGroup );
if ( (field.getField() == delim)
- || (pGroup == 0 && pDD->isField(field.getField())) )
+ || (pDD->isField(field.getField())) && (pGroup == 0 || pGroup->isSetField(field.getField())) )
{
if ( pGroup )
{

Initial fix is in the attachment.

Discussion

  • Oren Miller
    Oren Miller
    2012-02-28

    • status: open --> pending-accepted
     
  • Oren Miller
    Oren Miller
    2012-02-28

    I added a unit test setStringWithGroupWithoutDelimiter that validates the new behavior. It failed with the old code, and passes with the patch applied.