Tricky gpgme_wait bug.
Marcus Brinkmann
marcus.brinkmann at ruhr-uni-bochum.de
Fri Jun 3 00:53:44 CEST 2005
At Mon, 25 Apr 2005 13:51:58 -0400,
Igor Belyi <gpgme at katehok.ac93.org> wrote:
> > The extra sleep between gpgme_wait causes _gpgme_io_select to get
> > signal on more than one file handler for the same context. As a result
> > an error reported on the first handle causes all context handlers to
> > be closed and the associated data released. When the second selected
> > handle get processed it causes segmentation fault.
>
> And just to reply to myself, attached is a proposed patch fixing the
> problem.
Hi,
I have committed a simpler fix to CVS HEAD and the 1.0 branch: Just
break out of the loop, and go to the next iteration of the select()
(which will terminate as there are no more fds to select on).
I have also added a test case based on the one you sent us, and it
does no longer segfault.
gpgme/
2005-06-03 Marcus Brinkmann <marcus at g10code.de>
* wait-global.c (gpgme_wait): Break out of the fd processing loop
after an error.
Reported by Igor Belyi <gpgme at katehok.ac93.org>.
tests/
2005-06-03 Marcus Brinkmann <marcus at g10code.de>
* gpg/Makefile.am (TESTS): Add t-wait.
* gpg/t-wait.c (main): New test.
Thanks,
Marcus
More information about the Gnupg-devel
mailing list