]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Wed, 18 Aug 2010 01:38:05 +0000 (19:38 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Wed, 18 Aug 2010 01:38:05 +0000 (19:38 -0600)
Fix: In the case of an error while accessing a gopher server, squid will crash

The GopherStateData::req  used to retrieve the releated HttpRequest object in
gopherSendComplete function when a server while accessing the server occurs.

The GopherStateData::req is never assigned and it is always NULL (should be
removed?). The gopherState->fwd->request must be used instead.

src/gopher.cc

index 293059ee46de9f449d2fcee517e3e2dc1dbb9ea3..e04c05d18e61845c3175d0a500da6396dc927128 100644 (file)
@@ -892,7 +892,7 @@ gopherSendComplete(int fd, char *buf, size_t size, comm_err_t errflag, int xerrn
         ErrorState *err;
         err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE, gopherState->fwd->request);
         err->xerrno = errno;
-        err->port = gopherState->req->port;
+        err->port = gopherState->fwd->request->port;
         err->url = xstrdup(entry->url());
         gopherState->fwd->fail(err);
         comm_close(fd);