Details
Description
The parseGroup method in Message does not correctly detect an invalid group that starts with a non-subgroup field that is not the appropriate 'first field' for the group.
For instance, this incorrect NoRelatedSym group:
NoRelatedSym (146): 1
SecurityID (48): 31406TPB1
SecurityIDSource (22): 1
....
The first field should be a Symbol(55), but the symbol field is missing in this message. The parseGroup method will try to add the SecurityID (48) field to the group, but the group reference is still null because it hasn't encountered the correct first field yet. The fix is to check the firstFieldFound flag and throw an InvalidMessage exception if it isn't true. This is done correctly in the code for a subgroup field.
As a side note, Quickfix/C++ accepts this message without problem, but it probably shouldn't.