dirmngr: Avoid accessing uninitialized memory in log callback.
authorWerner Koch <wk@gnupg.org>
Tue, 16 Jun 2015 10:12:03 +0000 (12:12 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 16 Jun 2015 16:11:31 +0000 (18:11 +0200)
commit82c72e2db7bc5b633768d59822f2e2a353fa6e32
treeabf68c09e43e5c4ac1ac6a324fe0cdf0f72e3ff8
parent43211f553dd2741f855db4023fc4920da1c3789c
dirmngr: Avoid accessing uninitialized memory in log callback.

* dirmngr/dirmngr.c (pid_suffix_callback): Clear int_and_ptr_u before
use.
(start_connection_thread): Ditto.
(handle_connections): Ditto.
--

Example valgrind output:

==2921== Conditional jump or move depends on uninitialised value(s)
==2921==    at 0x5BBDEF4: pthread_getspecific (pthread_getspecific.c:57)
==2921==    by 0x40AAEE: pid_suffix_callback (dirmngr.c:614)
==2921==    by 0x433F5A: do_logv (logging.c:684)

This is because on 64 bit systems "sizeof aptr > sizeof aint" and thus
Valgrind complains about this.  It is no a real problem because we
don't use the unitialized bits.

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/dirmngr.c