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

Jenkins2 asteriskteam at digium.com
Wed Jul 5 18:29:29 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5958 )

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(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/main/data.c b/main/data.c
index 33a7c04..5972949 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/5958
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I2fbe7715681f43d5565d1e1599269468c26b0e0a
Gerrit-Change-Number: 5958
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170705/c054bfe8/attachment.html>


More information about the asterisk-code-review mailing list