Home GnuPG
Diffusion GnuPG e97e2ced6cf3

estream: Fix unclean usage of realloc.
e97e2ced6cf3Unpublished

Unpublished Commit · Learn More

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

Description

estream: Fix unclean usage of realloc.

* common/estream-printf.c (_ESTREAM_PRINTF_MALLOC): Remove.
(_ESTREAM_PRINTF_FREE): Remove.
(_ESTREAM_PRINTF_REALLOC): New.
(fixed_realloc) [!_ESTREAM_PRINTF_REALLOC]): New.
(estream_vasprintf): Use my_printf_realloc instead of my_printf_malloc
and my_printf_free.
(dynamic_buffer_out): Use my_printf_realloc instead of realloc.

This bug will never happen in current GnuPG/Libgcrypt because we use
the standard memory allocation functions via Libgcrypt. However, when
used in other environments it would mess up the heap for an asprintf
with an output length larger than ~512 bytes.

Details

Provenance
wernerAuthored on Jan 20 2012, 2:27 PM
Parents
rG7589e43b21c8: Do not copy default merge commit log entries into the ChangeLog.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rGe97e2ced6cf3: estream: Fix unclean usage of realloc. (authored by Werner Koch <wk@gnupg.org>).Jan 20 2012, 2:27 PM