Home GnuPG

mpi: Fix a subtle bug setting spurious bits with in mpi_set_bit.
af75f6294f5aUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

mpi: Fix a subtle bug setting spurious bits with in mpi_set_bit.

* mpi/mpi-bit.c (_gcry_mpi_set_bit, _gcry_mpi_set_highbit): Clear
allocated but not used bits before resizing.
* tests/t-mpi-bits.c (set_bit_with_resize): New.

This bug is probably with us for many years. Probably due to
different memory allocation patterns, it did first revealed itself
with 1.6. It could be the reason for other heisenbugs.

  • Reported-by: Martin Sewelies.
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on May 9 2014, 12:35 PM
Parents
rC534b04eb1077: Comment typo fix
Branches
Unknown
Tags
Unknown

Event Timeline