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

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


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


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/59/5959/1

diff --git a/main/data.c b/main/data.c
index 1aaae18..a65d0b8 100644
--- a/main/data.c
+++ b/main/data.c
@@ -3145,6 +3145,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/5959
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fbe7715681f43d5565d1e1599269468c26b0e0a
Gerrit-Change-Number: 5959
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/db7d7b60/attachment-0001.html>


More information about the asterisk-code-review mailing list