Typo causing segmentation fault for gpgme_wait(NULL, ..)

Igor Belyi gpgme at katehok.ac93.org
Wed Mar 30 05:16:21 CEST 2005


Ok, here's the last patch in this short burst of a desire to help. :)

When the first argument of the gpgme_wait is NULL it causes segmentation
fault due to a small typo in the code. The attached patch fixes the problem.

Hope it helps,
Igor

--------------------- the old good cut here line ---------------------
--- gpgme1.0-1.0.2/gpgme/wait-global.c.orig     2005-03-29 
20:55:31.000000000 -0500
+++ gpgme1.0-1.0.2/gpgme/wait-global.c  2005-03-29 20:56:31.000000000 -0500
@@ -331,13 +331,13 @@
        LOCK (ctx_list_lock);
        for (li = ctx_active_list; li; li = li->next)
         {
-         for (i = 0; i < ctx->fdt.size; i++)
-           if (ctx->fdt.fds[i].fd != -1)
+         for (i = 0; i < li->ctx->fdt.size; i++)
+           if (li->ctx->fdt.fds[i].fd != -1)
               break;
-         if (i == ctx->fdt.size)
+         if (i == li->ctx->fdt.size)
             {
               gpgme_error_t err = 0;
-             _gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err);
+             _gpgme_engine_io_event (li->ctx->engine, GPGME_EVENT_DONE, 
&err);
             }
         }
        UNLOCK (ctx_list_lock);




More information about the Gnupg-devel mailing list