dbosanzio / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

Reference set in maybe_add_pivot() can cause crash #161

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

The following code sets req->pivot and causes unexpected behavior.  One way it 
manifests itself is in a crash that happens when (all) 404 checks fail.  Not 
very common but otoh not very hard to reproduce either.

The following patch will be in 2.09b, expected to be out later today.

--- skipfish-2.08b-orig/database.c  2012-09-01 07:53:25.000000000 +0200
+++ skipfish-2.09b/src/database.c   2012-09-02 08:47:53.833801863 +0200
@@ -406,9 +406,6 @@

     }

-    /* Store a reference in our the callers request struct. */
-    req->pivot = cur;
-
     /* At this point, 'cur' points to a newly created or existing node
        for the path element. If this element is parametric, make sure
        that its value is on the 'try' list. */
@@ -542,10 +539,6 @@

   }

-  /* Set the request pivot, if not set already */
-  if(!req->pivot)
-    req->pivot = cur;
-
   /* Done, at last! */

 }

Original issue reported on code.google.com by niels.he...@gmail.com on 2 Sep 2012 at 8:58

GoogleCodeExporter commented 8 years ago

Fixed in the 2.09b release.

Original comment by niels.he...@gmail.com on 2 Sep 2012 at 12:28