Module: kamailio
Branch: master
Commit: dfe8db758f84f5e88e0cb35b80a65dcd48158897
URL:
https://github.com/kamailio/kamailio/commit/dfe8db758f84f5e88e0cb35b80a65dc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-10-01T10:28:43+02:00
core: init local structs to avoid use of garbage values
---
Modified: src/core/forward.c
Modified: src/core/ip_addr.h
---
Diff:
https://github.com/kamailio/kamailio/commit/dfe8db758f84f5e88e0cb35b80a65dc…
Patch:
https://github.com/kamailio/kamailio/commit/dfe8db758f84f5e88e0cb35b80a65dc…
---
diff --git a/src/core/forward.c b/src/core/forward.c
index 8216ccf88a..a31c1c2af5 100644
--- a/src/core/forward.c
+++ b/src/core/forward.c
@@ -471,6 +471,7 @@ int forward_request(struct sip_msg* msg, str* dst, unsigned short
port,
prev_send_sock=0;
err=0;
+ memset(&dns_srv_h, 0, sizeof(struct dns_srv_handle));
#endif
buf=0;
diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h
index 668179c45e..afbaece075 100644
--- a/src/core/ip_addr.h
+++ b/src/core/ip_addr.h
@@ -421,6 +421,7 @@ static inline void su2ip_addr(struct ip_addr* ip, union
sockaddr_union* su)
break;
default:
LM_CRIT("unknown address family %d\n", su->s.sa_family);
+ memset(ip, 0, sizeof(ip_addr_t));
}
}