summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c14
-rw-r--r--main/netsock2.c4
2 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6d8e3e0e5..f542a112c 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13551,6 +13551,20 @@ static int parse_ok_contact(struct sip_pvt *pvt, struct sip_request *req)
/*! \brief parse uri in a way that allows semicolon stripping if legacy mode is enabled */
static int parse_uri_legacy_check(char *uri, const char *scheme, char **user, char **pass, char **domain, char **transport) {
+ /* Assume invalid to start */
+ if (user) {
+ *user = 0;
+ }
+ if (pass) {
+ *pass = 0;
+ }
+ if (domain) {
+ *domain = 0;
+ }
+ if (transport) {
+ *transport = 0;
+ }
+
int ret = parse_uri(uri, scheme, user, pass, domain, transport);
if (sip_cfg.legacy_useroption_parsing) { /* if legacy mode is active, strip semis from the user field */
char *p;
diff --git a/main/netsock2.c b/main/netsock2.c
index 6f55b3b3b..25f15a2fc 100644
--- a/main/netsock2.c
+++ b/main/netsock2.c
@@ -232,6 +232,10 @@ int ast_sockaddr_resolve(struct ast_sockaddr **addrs, const char *str,
char *s, *host, *port;
int e, i, res_cnt;
+ if (!str) {
+ return 0;
+ }
+
s = ast_strdupa(str);
if (!ast_sockaddr_split_hostport(s, &host, &port, flags)) {
return 0;