[QFJ-980] NPE during message parsing if repeating group's first tag is undefined Created: 19/Jul/19  Updated: 17/Jun/20  Resolved: 19/Jul/19

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.6.4, 2.1.1
Fix Version/s: 2.2.0

Type: Bug Priority: Major
Reporter: Emil Rakadjiev Assignee: Christoph John
Resolution: Fixed Votes: 0
Labels: None


 Description   

If a message contains a repeating group in which the first tag is not defined in the dictionary, a NullPointerException is thrown while parsing the message/group.

To reproduce, you can use this FIX string with the standard 4.2 dictionary.
It contains an undefined tag (9876) as the first tag of the NoAllocs (78) repeating group.

8=FIX.4.2|9=130|35=D|34=2|49=SND1|52=20190719-04:56:39.042|56=TGT1|11=1|78=1|9876=npe|79=a|80=1|21=1|55=x|54=1|60=20190719-04:56:53.826|38=1|40=1|10=169|

Here is the stack trace for 1.6.4:

Exception in thread "main" java.lang.NullPointerException
	at quickfix.Message.checkFieldValidation(Message.java:662)
	at quickfix.Message.parseGroup(Message.java:633)
	at quickfix.Message.parseBody(Message.java:559)
	at quickfix.Message.parse(Message.java:470)
	at quickfix.Message.fromString(Message.java:453)
	[...]

and for 2.1.1:

Exception in thread "main" java.lang.NullPointerException
	at quickfix.Message.checkFieldValidation(Message.java:748)
	at quickfix.Message.parseGroup(Message.java:711)
	at quickfix.Message.parseBody(Message.java:637)
	at quickfix.Message.parse(Message.java:548)
	at quickfix.Message.fromString(Message.java:531)
	[...]


 Comments   
Comment by Christoph John [ 19/Jul/19 ]

Hi Emil,

thanks for the report. If I am not mistaken the problem will be solved by the following PR: https://github.com/quickfix-j/quickfixj/pull/222
I will merge this in due course. But I don't know when the next patch release will be built. But maybe you can build your own for the time being.

Cheers,
Chris.

Comment by Emil Rakadjiev [ 19/Jul/19 ]

Hello Chris,

Thank you for the quick reply!
I hadn't seen that PR on GitHub, sorry.
It does fix the issue, so all is good.

Thanks again and cheers!

Comment by Christoph John [ 19/Jul/19 ]

Hi Emil,
no problem, you're welcome.
Cheers
Chris.

Generated at Mon May 06 18:00:08 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.