various files - fix some alerts raised by lgtm code analysis

This patch fixes several issues reported by the lgtm code analysis tool:

https://lgtm.com/projects/g/asterisk/asterisk

Not all reported issues were addressed in this patch. This patch mostly fixes
confirmed reported errors, potential problematic code points, and a few other
"low hanging" warnings or recommendations found in core supported modules.
These include, but are not limited to the following:

* innapropriate stack allocation in loops
* buffer overflows
* variable declaration "hiding" another variable declaration
* comparisons results that are always the same
* ambiguously signed bit-field members
* missing header guards

Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
This commit is contained in:
Kevin Harwell
2019-10-23 12:36:17 -05:00
committed by George Joseph
parent 990a91b44a
commit bdd785d31c
49 changed files with 324 additions and 203 deletions

View File

@@ -165,7 +165,7 @@ static struct aco_type user_option = {
.item_offset = offsetof(struct ast_ari_conf, users),
};
static struct aco_type *user[] = ACO_TYPES(&user_option);
static struct aco_type *global_user[] = ACO_TYPES(&user_option);
static void conf_general_dtor(void *obj)
{
@@ -361,16 +361,16 @@ int ast_ari_config_init(void)
"", channelvars_handler, 0);
/* ARI type=user category options */
aco_option_register(&cfg_info, "type", ACO_EXACT, user, NULL,
aco_option_register(&cfg_info, "type", ACO_EXACT, global_user, NULL,
OPT_NOOP_T, 0, 0);
aco_option_register(&cfg_info, "read_only", ACO_EXACT, user,
aco_option_register(&cfg_info, "read_only", ACO_EXACT, global_user,
"no", OPT_BOOL_T, 1,
FLDSET(struct ast_ari_conf_user, read_only));
aco_option_register(&cfg_info, "password", ACO_EXACT, user,
aco_option_register(&cfg_info, "password", ACO_EXACT, global_user,
"", OPT_CHAR_ARRAY_T, 0,
FLDSET(struct ast_ari_conf_user, password), ARI_PASSWORD_LEN);
aco_option_register_custom(&cfg_info, "password_format", ACO_EXACT,
user, "plain", password_format_handler, 0);
global_user, "plain", password_format_handler, 0);
return process_config(0);
}