From dc77056437147deb992eca9ea718fed639dd2184 Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Thu, 9 Oct 2025 09:58:16 -0600 Subject: [PATCH] realip: Add null check for netvc --- plugins/experimental/realip/pp.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/experimental/realip/pp.cc b/plugins/experimental/realip/pp.cc index 269c2c0dd32..876c45acc96 100644 --- a/plugins/experimental/realip/pp.cc +++ b/plugins/experimental/realip/pp.cc @@ -38,7 +38,8 @@ ProxyProtocolAddressSource::get_address(TSHttpTxn txnp, struct sockaddr_storage int pp_addr_len; TSVConn vconn = TSHttpSsnClientVConnGet(TSHttpTxnSsnGet(txnp)); - if (TSVConnPPInfoGet(vconn, TS_PP_INFO_SRC_ADDR, reinterpret_cast(&pp_addr), &pp_addr_len) == TS_SUCCESS) { + if (vconn != nullptr && + TSVConnPPInfoGet(vconn, TS_PP_INFO_SRC_ADDR, reinterpret_cast(&pp_addr), &pp_addr_len) == TS_SUCCESS) { if (pp_addr->sa_family == AF_INET) { memcpy(addr, pp_addr, sizeof(struct sockaddr_in)); ret = reinterpret_cast(addr);