[Asterisk-code-review] res pjsip: Fix segfault when status fails (asterisk[master])

Jørgen H asteriskteam at digium.com
Thu Feb 16 04:18:28 CST 2017


Jørgen H has uploaded a new change for review. ( https://gerrit.asterisk.org/4967 )

Change subject: res_pjsip: Fix segfault when status fails
......................................................................

res_pjsip: Fix segfault when status fails

ASTERISK-26623 #close

Change-Id: Id52d3ca4d788562d236da49990a319118f8d22b5
---
M res/res_pjsip/pjsip_options.c
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/4967/1

diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 6fd3c25..1326500 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1236,6 +1236,12 @@
 		ast_sip_get_sorcery(), CONTACT_STATUS,
 		ast_sorcery_object_get_id(contact));
 
+	if (!status) {
+		ast_free(buf);
+		return -1;
+	}
+
+
 	ast_str_append(&buf, 0, "AOR: %s\r\n", wrapper->aor_id);
 	ast_str_append(&buf, 0, "URI: %s\r\n", contact->uri);
 	ast_str_append(&buf, 0, "UserAgent: %s\r\n", contact->user_agent);

-- 
To view, visit https://gerrit.asterisk.org/4967
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id52d3ca4d788562d236da49990a319118f8d22b5
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Jørgen H <asterisk.org at hovland.cx>



More information about the asterisk-code-review mailing list