gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24246 - Extractor/src/main


From: gnunet
Subject: [GNUnet-SVN] r24246 - Extractor/src/main
Date: Tue, 9 Oct 2012 22:27:18 +0200

Author: grothoff
Date: 2012-10-09 22:27:17 +0200 (Tue, 09 Oct 2012)
New Revision: 24246

Modified:
   Extractor/src/main/extractor.c
   Extractor/src/main/extractor_ipc_gnu.c
   Extractor/src/main/extractor_ipc_w32.c
Log:
-trying to fix rare, random use-after-free if interacting with broken plugins

Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c      2012-10-09 19:59:18 UTC (rev 24245)
+++ Extractor/src/main/extractor.c      2012-10-09 20:27:17 UTC (rev 24246)
@@ -458,14 +458,6 @@
       plugin_off = 0;
       for (pos = plugins; NULL != pos; pos = pos->next)
        {
-         if ( (NULL == channels[plugin_off]) &&
-              (-1 == pos->seek_request) )
-           {
-             /* EXTRACTOR_IPC_channel_recv_ got a non-NULL channel (-1 == 
seek_request)
-                but set it to NULL; that means the channel had an IPC error 
and was closed;
-                so we need to update the plugin accordingly */
-             pos->channel = NULL;
-           }
          plugin_off++;
          if ( (1 == pos->round_finished) ||
               (NULL == pos->channel) )

Modified: Extractor/src/main/extractor_ipc_gnu.c
===================================================================
--- Extractor/src/main/extractor_ipc_gnu.c      2012-10-09 19:59:18 UTC (rev 
24245)
+++ Extractor/src/main/extractor_ipc_gnu.c      2012-10-09 20:27:17 UTC (rev 
24246)
@@ -28,6 +28,7 @@
 #include "extractor_datasource.h"
 #include "extractor_logging.h"
 #include "extractor_plugin_main.h"
+#include "extractor_plugins.h"
 #include "extractor_ipc.h"
 #include <dirent.h>
 #include <sys/types.h>
@@ -372,6 +373,8 @@
     LOG_STRERROR ("close");
   if (0 != close (channel->cpipe_in))
     LOG_STRERROR ("close");
+  if (NULL != channel->plugin)
+    channel->plugin->channel = NULL;
   free (channel->mdata);
   free (channel);
 }

Modified: Extractor/src/main/extractor_ipc_w32.c
===================================================================
--- Extractor/src/main/extractor_ipc_w32.c      2012-10-09 19:59:18 UTC (rev 
24245)
+++ Extractor/src/main/extractor_ipc_w32.c      2012-10-09 20:27:17 UTC (rev 
24246)
@@ -599,6 +599,8 @@
     free (channel->ov_write_buffer);
     channel->ov_write_buffer = NULL;
   }
+  if (NULL != channel->plugin)
+    channel->plugin->channel = NULL;
   free (channel->mdata);
   free (channel);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]