[Asterisk-code-review] core: Fix segfault when invoking 'data get' CLI command (asterisk[master])

Sean Bright asteriskteam at digium.com
Wed Jul 5 07:44:42 CDT 2017


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/5960


Change subject: core: Fix segfault when invoking 'data get' CLI command
......................................................................

core: Fix segfault when invoking 'data get' CLI command

Invoking 'data get /asterisk/core/channeltypes' caused a crash because
of an assumption of a tech's capabilities to be non-NULL. The
'Surrogate' tech, however, does have a NULL capabilities member,
resulting in a crash.

ASTERISK-27108 #close

Change-Id: I2fbe7715681f43d5565d1e1599269468c26b0e0a
---
M main/data.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/5960/1

diff --git a/main/data.c b/main/data.c
index 15aca8b..18488df 100644
--- a/main/data.c
+++ b/main/data.c
@@ -3143,6 +3143,10 @@
 		return -1;
 	}
 
+	if (!cap) {
+		return 0;
+	}
+
 	count = ast_format_cap_count(cap);
 	for (i = 0; i < count; ++i) {
 		struct ast_format *fmt;

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fbe7715681f43d5565d1e1599269468c26b0e0a
Gerrit-Change-Number: 5960
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170705/d722f4d9/attachment.html>


More information about the asterisk-code-review mailing list