From b484974d822139d2bc0dd344995e9f27ae3c1fe1 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 3 May 2011 09:55:35 +0000 Subject: [PATCH] Prevent a NULL-pointer dereference in connect_to() It happened in case of address resolution failures when there was no forwarding proxy enabled for the request in the config file and forward-override{} wasn't used at all. Regression introduced in v1.98 by yours truly. Patch submitted by saperski in #3296527. --- jbsockets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jbsockets.c b/jbsockets.c index ae9e6bc2..8d14cdf6 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.99 2011/04/19 13:00:47 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.100 2011/04/27 18:11:05 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -158,6 +158,7 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) fd = no_rfc2553_connect_to(host, portnum, csp); #endif if ((fd != JB_INVALID_SOCKET) || (errno == EINVAL) + || (csp->fwd == NULL) || ((csp->fwd->forward_host == NULL) && (csp->fwd->type == SOCKS_NONE))) { break; -- 2.39.2