-
Notifications
You must be signed in to change notification settings - Fork 458
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
BERTLVPackager throws a java.lang.ArithmeticException: divide by zero #315
Comments
We're currently using version 2.1.3, just in case you'll need that info. |
Thanks for the bug report and suggested solution. |
Happy to help. |
The Exception is definitely an error, but I believe a zero length tag is still valid and need to be encoded anyway. |
Fair enough. So will it be encoded with a |
I just added a test for a zero length tag, and it works OK. Perhaps you can run it there |
Relates jpos#315
Awesome! Is there a planned release date for this fix? |
Q4/2020 is a reasonable bet, but you can use a pinned SNAPSHOT meanwhile. |
Is that something you need to do, the pinned SNAPSHOT? |
No, you just specify the full snapshot filename, including timestamp. |
Awesome, thanks! |
Whenever a tag is specified with a length of zero, rather than the tag getting ignored, the implementation is throwing a divide by zero exception.
Looking through the code, I believe that changing lines 259 - 272 from:
to:
should solve the issue.
The problem here is that both
getUninterpretLength()
andunpackValue()
will fail with this exception, however, there's no need to call them if the data length is indeed zero.The text was updated successfully, but these errors were encountered: