ast_str: Fix improper member access to struct ast_str members.

Accessing members of struct ast_str outside of the string manipulation API
routines is invalid since struct ast_str is supposed to be treated as
opaque.

Review: https://reviewboard.asterisk.org/r/4194/
........

Merged revisions 428244 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428245 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 428246 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-11-19 17:22:29 +00:00
parent 7f8b7ace72
commit a7c9f4c668
4 changed files with 15 additions and 14 deletions

View File

@@ -2147,6 +2147,7 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
struct manager_action *cur;
struct ast_str *authority;
int num, l, which;
const char *auth_str;
char *ret = NULL;
#ifdef AST_XML_DOCS
char syntax_title[64], description_title[64], synopsis_title[64], seealso_title[64];
@@ -2194,7 +2195,7 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
AST_RWLIST_TRAVERSE(&actions, cur, list) {
for (num = 3; num < a->argc; num++) {
if (!strcasecmp(cur->action, a->argv[num])) {
authority_to_str(cur->authority, &authority);
auth_str = authority_to_str(cur->authority, &authority);
#ifdef AST_XML_DOCS
if (cur->docsrc == AST_XML_DOC) {
@@ -2203,7 +2204,7 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
char *description = ast_xmldoc_printable(S_OR(cur->description, "Not available"), 1);
char *arguments = ast_xmldoc_printable(S_OR(cur->arguments, "Not available"), 1);
char *seealso = ast_xmldoc_printable(S_OR(cur->seealso, "Not available"), 1);
char *privilege = ast_xmldoc_printable(S_OR(authority->str, "Not available"), 1);
char *privilege = ast_xmldoc_printable(S_OR(auth_str, "Not available"), 1);
char *responses = ast_xmldoc_printable("None", 1);
ast_cli(a->fd, "%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s",
syntax_title, syntax,
@@ -2237,7 +2238,7 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_
{
ast_cli(a->fd, "Action: %s\nSynopsis: %s\nPrivilege: %s\n%s\n",
cur->action, cur->synopsis,
authority->str,
auth_str,
S_OR(cur->description, ""));
}
}