Closed alovak closed 2 years ago
Right, The code is very dangerous code main parser that included MTI(bitmap) don't run correctly it seems that we should update composite field only for https://github.com/moov-io/iso8583/pull/149
Hey @Dakinola892 as you were the author of #149 I want to ask for your feedback and maybe help us with finding the best solution to the issue.
I believe I added #149 as a band-aid fix to a problem we were having locally with parsing, but with the updatest to moov its no longer a problem, so i think mfdevelopers's PR to remove it is a decent enough solution
Currently, if we set an empty value to the field with the fixed and variable length prefix, there will be no error when we pack such a message. Receiving side will get malformed data and will try to parse it...
It looks like for empty values we skip the length check, but we should not:
https://github.com/moov-io/iso8583/blob/master/field/string.go#L67:
this is not a simple fix, as this
if/return
was added to fix other issue: https://github.com/moov-io/iso8583/pull/149Example of the error when field 48 - Acceptor name is empty and receiving party is trying to read LLL prefix (which was not put into the message as we skip adding prefix because of ^^) and reads the value of the next field (49, currency code) instead: