Home GnuPG
Diffusion GnuPG 99972bd6e9ab

gpg: Fix bug parsing a zero length user id.
99972bd6e9abUnpublished

Unpublished Commit · Learn More

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

Description

gpg: Fix bug parsing a zero length user id.

* g10/getkey.c (get_user_id): Do not call xmalloc with 0.
* common/xmalloc.c (xmalloc, xcalloc): Take extra precaution not to
pass 0 to the arguments.

The problem did not occur in 1.x because over there the xmalloc makes
sure to allocate at least one byte. With 2.x for most calls the
xmalloc of Libgcrypt is used and Libgcrypt returns an error insteead
of silent allocating a byte. Thus gpg 2.x bailed out with an
"Fatal: out of core while allocating 0 bytes".

The extra code in xmalloc.c is for more robustness for the other
xmalloc calls.

Details

Provenance
wernerAuthored on Jun 2 2014, 11:47 AM
Parents
rG9e1c99f8009f: dirmngr: Print certificates on failed TLS verification.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG99972bd6e9ab: gpg: Fix bug parsing a zero length user id. (authored by Werner Koch <wk@gnupg.org>).Jun 2 2014, 11:47 AM