You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2021/04/10 15:32:06 UTC

svn commit: r1888588 - /subversion/trunk/subversion/libsvn_subr/task.c

Author: stefan2
Date: Sat Apr 10 15:32:06 2021
New Revision: 1888588

URL: http://svn.apache.org/viewvc?rev=1888588&view=rev
Log:
Fix segfault when the root task has output to process.

* subversion/libsvn_subr/task.c
  (remove_task): Make sure we don't access the RESULTS after freeing
                 the memory.

Modified:
    subversion/trunk/subversion/libsvn_subr/task.c

Modified: subversion/trunk/subversion/libsvn_subr/task.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/task.c?rev=1888588&r1=1888587&r2=1888588&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/task.c (original)
+++ subversion/trunk/subversion/libsvn_subr/task.c Sat Apr 10 15:32:06 2021
@@ -466,6 +466,12 @@ static svn_error_t *remove_task(svn_task
       if (parent->last_sub == task)
         parent->last_sub = NULL;
     }
+  else
+    {
+      /* Root task.  Keep it because we might rely on it being present.
+       * However, make sure nobody tries to process its outputs twice. */
+      task->results = NULL;
+    }
 
   return SVN_NO_ERROR;
 }