mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -3145,6 +3145,10 @@ int ast_data_add_codecs(struct ast_data *root, const char *node_name, struct ast
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!cap) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
count = ast_format_cap_count(cap);
|
||||
for (i = 0; i < count; ++i) {
|
||||
struct ast_format *fmt;
|
||||
|
Reference in New Issue
Block a user