Workaround for BN_bn2mpi reading/writing out of bounds
authorPieter Wuille <pieter.wuille@gmail.com>
Sat, 18 Feb 2012 12:32:25 +0000 (13:32 +0100)
committerLuke Dashjr <luke-jr+git@utopios.org>
Mon, 19 Mar 2012 23:08:19 +0000 (19:08 -0400)
commit0e6c6e3fd1ab971c652e48fa04bac097e44e76fe
treeeb6cf55d441bb107d23a67c40f86d6d4aaf49c24
parent1194f003504fa6e9d9f59012ec736ebc7c231360
Workaround for BN_bn2mpi reading/writing out of bounds

When OpenSSL's BN_bn2mpi is passed a buffer of size 4, valgrind
reports reading/writing one byte past it. I am unable to find
evidence of this behaviour in BN_bn2mpi's source code, so it may
be a spurious warning. However, this change is harmless, as only
the bignum with value 0 results in an mpi serialization of size 4.
src/bignum.h