upstream commit
some explicit NULL tests when dumping configured
forwardings; from Karsten Weiss
Upstream-ID: 40957b8dea69672b0e50df6b4a91a94e3e37f72d
diff --git a/readconf.c b/readconf.c
index 7194b0c..5064e33 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.264 2017/01/06 09:27:52 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.265 2017/01/30 00:34:01 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2451,10 +2451,10 @@
/* oDynamicForward */
for (i = 0; i < count; i++) {
fwd = &fwds[i];
- if (code == oDynamicForward &&
+ if (code == oDynamicForward && fwd->connect_host != NULL &&
strcmp(fwd->connect_host, "socks") != 0)
continue;
- if (code == oLocalForward &&
+ if (code == oLocalForward && fwd->connect_host != NULL &&
strcmp(fwd->connect_host, "socks") == 0)
continue;
printf("%s", lookup_opcode_name(code));