diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-01-23 09:29:26 +0100 |
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-01-23 12:04:52 +0100 |
| commit | 39c8c97d41616c6fb0abf92c48c24b8efd2a7ffe (patch) | |
| tree | 6236e9f64a7ccd18b0e8f4e47654ea684cc08c6c | |
| parent | 8c8bb3568a581691403493354d4a1fad02f24c91 (diff) | |
bgpd: fix deference before check in rpki_create_socket
Fix deference before check coverity scanner issue 1575918 in
rpki_create_socket()
Fixes: a951752d4a ("bgpd: create cache server socket in vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
| -rw-r--r-- | bgpd/bgp_rpki.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 332f3c8def..de5476173d 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1276,7 +1276,7 @@ static int rpki_create_socket(void *_cache) { struct timeval prev_snd_tmout, prev_rcv_tmout, timeout; struct cache *cache = (struct cache *)_cache; - struct rpki_vrf *rpki_vrf = cache->rpki_vrf; + struct rpki_vrf *rpki_vrf; struct tr_tcp_config *tcp_config; struct addrinfo *res = NULL; struct addrinfo hints = {}; @@ -1294,6 +1294,8 @@ static int rpki_create_socket(void *_cache) if (!cache) return -1; + rpki_vrf = cache->rpki_vrf; + if (rpki_vrf->vrfname == NULL) vrf = vrf_lookup_by_id(VRF_DEFAULT); else |
