[erlang-patches] fixed reading compressed binary terms from Java

Nico Kruber <>
Tue Jun 12 16:59:53 CEST 2012


thanks to the tip from Raimo Niskanen, I was able to write the accompanying 
unit test for my patch.

Find both in
https://github.com/NicoK/otp/compare/erlang:master...NicoK:jinterface.fix_compressed_binary
https://github.com/NicoK/otp/compare/erlang:master...NicoK:jinterface.fix_compressed_binary.patch

I re-based the branch onto master, but this could of course also be applied to 
maint if another R15 is planned...


Regards
Nico Kruber

On Friday 27 April 2012 10:23:37 Henrik Nord wrote:
> Hi
> 
> I would like you to add a test for this. As there already are compress
> and decompress roundtrip tests,
> the effort should be minimal for adding tests for this specific bug.
> 
> Also the commit message should conform to
> (fix, not fixed etc..)
> 
> https://github.com/erlang/otp/wiki/Writing-good-commit-messages
> 
> Thank you for the contribution!
> 
> On 04/25/2012 10:48 AM, Nico Kruber wrote:
> > Problem was that when reading from an InputStream, you can only specify a
> > maximum number of bytes to read. Java doesn't guarantee that it actually
> > reads this many bytes - it could be less!
> > 
> > This patch now reads up until the expected size number of bytes. If there
> > are more than expected, the actual number of available bytes is not
> > printed (we probably shouldn't read the additional bytes, security-wise -
> > the erlang external byte representation is broken in this case though).
> > 
> > I applied a patch posted on erlang-questins in September 2009, see
> > http://erlang.org/pipermail/erlang-patches/2009-September/000478.html
> > It was not enough to fix the bug though so I extended this patch a little.


More information about the erlang-patches mailing list