From 356a403a17b05c0c6a92db29112032c7a5502118 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Wed, 12 Feb 2020 01:39:18 +0000 Subject: [PATCH] [sofia-sip] scan-build: Access to field 'ai_addr' results in a dereference of a null pointer (loaded from variable 'res') --- libs/sofia-sip/libsofia-sip-ua/tport/tport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c index fbfdfa56b6..9eca15f77a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c @@ -1661,6 +1661,8 @@ int tport_bind_server(tport_master_t *mr, for (tbf = &mr->mr_primaries; *tbf; tbf = &(*tbf)->pri_next) ; + if (!res) + return -1; port = port0 = port1 = ntohs(((su_sockaddr_t *)res->ai_addr)->su_port); error = EPROTONOSUPPORT;