erlang/otp — pull request #62 by dotsimon (2013-08-30 19:01:51+00:00)
Title: Fix decoding of numbers that are encoded as an odd number of bytes.

When a number is encoded as ERL_SMALL_BIG_EXT and the external
representation is an odd number of bytes it may be incorrectly decoded
by ei_decode_big.

An example of such an encoded number is:

Eshell V5.10.2 (abort with ^G)
1> term_to_binary(4297024617).
<<131,110,5,0,105,100,31,0,1>>

I tried to make a test for this using the published APIs (ie. not ei_decode_big directly) but since the bug depends on the values in the unused part of the dt arrary I did not succeed. We came across this bug in a production system where a linked-in driver was using erl_compare_ext and the results were not consistently correct.