From: Gert Doering Date: Fri, 8 May 2026 17:31:51 +0200 Message-ID: <20260508153156.13575-1-gert@...1296...> In-Reply-To: References: MIME-Version: 1.0 Subject: [Openvpn-devel] [PATCH v1] pool: Fix a potential NULL pointer de-reference in test code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net From: Frank Lichtenheld Identified by cppcheck. Probably has been a long time since that code has been compiled, though. Change-Id: I09ebbf6f3555dd68ce8d75bfa844ecac518a0cf2 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1676 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1676 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/pool.c b/src/openvpn/pool.c index 15004c0..ff74e7c 100644 --- a/src/openvpn/pool.c +++ b/src/openvpn/pool.c @@ -757,7 +757,7 @@ break; } msg(M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 1: l=%s r=%s cn=%s", - print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn); + print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn ? cn : "[NULL]"); array[i] = h; } @@ -793,7 +793,7 @@ break; } msg(M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 3: l=%s r=%s cn=%s", - print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn); + print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn ? cn : "[NULL]"); array[i] = h; }