Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISOBinaryFieldPackager doesn't check max length when packing variable length fields #611

Open
hello-koval opened this issue Aug 29, 2024 · 1 comment

Comments

@hello-koval
Copy link

if (packedLength == 0 && data.length != getLength()) {

It looks like there should be a check for variable length fields too. E.g., if I created new IFB_LLLHBINARY( 9999, "xxx") packager, I would expect an exception when packing 10000 bytes.

@ar
Copy link
Member

ar commented Aug 29, 2024

You're correct, in ISOStringFieldPackager we have:

    if (data.length() > getLength())
        throw new ISOException("Field length " + data.length() + " too long. Max: " + getLength());

no reason not to have it in the ISOBinaryFieldPackager counterpart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants