Fixes for GCC 9
Various fixes for issues caught by gcc 9. Mostly snprintf trying to copy to a buffer potentially too small. ASTERISK-28412 Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
This commit is contained in:
parent
85242a9bb9
commit
c5c953c1f1
|
@ -588,7 +588,7 @@ static struct adsi_subscript *getsubbyname(struct adsi_script *state, char *name
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->numsubs > 127) {
|
if (state->numsubs > 127) {
|
||||||
ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, script);
|
ast_log(LOG_WARNING, "No more subscript space at line %d of %s\n", lineno, S_OR(script, "unknown"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ struct findme_user {
|
||||||
long digts;
|
long digts;
|
||||||
int ynidx;
|
int ynidx;
|
||||||
int state;
|
int state;
|
||||||
char dialarg[256];
|
char dialarg[768];
|
||||||
/*! Collected digits to accept/decline the call. */
|
/*! Collected digits to accept/decline the call. */
|
||||||
char yn[MAX_YN_STRING];
|
char yn[MAX_YN_STRING];
|
||||||
/*! TRUE if the outgoing call is answered. */
|
/*! TRUE if the outgoing call is answered. */
|
||||||
|
|
|
@ -849,10 +849,10 @@ static char *cli_console_dial(struct ast_cli_entry *e, int cmd, struct ast_cli_a
|
||||||
if (a->argc == e->args + 1) {
|
if (a->argc == e->args + 1) {
|
||||||
char *ext = NULL, *con = NULL;
|
char *ext = NULL, *con = NULL;
|
||||||
s = ast_ext_ctx(pvt, a->argv[e->args], &ext, &con);
|
s = ast_ext_ctx(pvt, a->argv[e->args], &ext, &con);
|
||||||
ast_debug(1, "provided '%s', exten '%s' context '%s'\n",
|
|
||||||
a->argv[e->args], mye, myc);
|
|
||||||
mye = ext;
|
mye = ext;
|
||||||
myc = con;
|
myc = con;
|
||||||
|
ast_debug(1, "provided '%s', exten '%s' context '%s'\n",
|
||||||
|
a->argv[e->args], mye, myc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* supply default values if needed */
|
/* supply default values if needed */
|
||||||
|
|
|
@ -3814,7 +3814,7 @@ static int peer_status(struct iax2_peer *peer, char *status, int statuslen)
|
||||||
/*! \brief Show one peer in detail */
|
/*! \brief Show one peer in detail */
|
||||||
static char *handle_cli_iax2_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
static char *handle_cli_iax2_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
{
|
{
|
||||||
char status[30];
|
char status[64];
|
||||||
char cbuf[256];
|
char cbuf[256];
|
||||||
struct iax2_peer *peer;
|
struct iax2_peer *peer;
|
||||||
struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
|
struct ast_str *codec_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
|
||||||
|
@ -6836,7 +6836,7 @@ struct show_peers_context {
|
||||||
static void _iax2_show_peers_one(int fd, struct mansession *s, struct show_peers_context *cont, struct iax2_peer *peer)
|
static void _iax2_show_peers_one(int fd, struct mansession *s, struct show_peers_context *cont, struct iax2_peer *peer)
|
||||||
{
|
{
|
||||||
char name[256] = "";
|
char name[256] = "";
|
||||||
char status[20];
|
char status[64];
|
||||||
int retstatus;
|
int retstatus;
|
||||||
struct ast_str *encmethods = ast_str_alloca(256);
|
struct ast_str *encmethods = ast_str_alloca(256);
|
||||||
|
|
||||||
|
|
|
@ -160,8 +160,8 @@ static void bucket_file_update_path(struct ast_bucket_file *bucket_file,
|
||||||
sizeof(bucket_file->path));
|
sizeof(bucket_file->path));
|
||||||
} else if (!strchr(bucket_file->path, '.') && (ext = strrchr(ast_sorcery_object_get_id(bucket_file), '.'))) {
|
} else if (!strchr(bucket_file->path, '.') && (ext = strrchr(ast_sorcery_object_get_id(bucket_file), '.'))) {
|
||||||
/* If we don't have a file extension and were provided one in the URI, use it */
|
/* If we don't have a file extension and were provided one in the URI, use it */
|
||||||
char new_path[PATH_MAX];
|
char found_ext[32];
|
||||||
char found_ext[PATH_MAX];
|
char new_path[PATH_MAX + sizeof(found_ext)];
|
||||||
|
|
||||||
ast_bucket_file_metadata_set(bucket_file, "ext", ext);
|
ast_bucket_file_metadata_set(bucket_file, "ext", ext);
|
||||||
|
|
||||||
|
|
|
@ -2123,7 +2123,7 @@ static void build_secret(char *secret, int seclen)
|
||||||
|
|
||||||
static void save_secret(const char *newkey, const char *oldkey)
|
static void save_secret(const char *newkey, const char *oldkey)
|
||||||
{
|
{
|
||||||
char tmp[256];
|
char tmp[350];
|
||||||
if (oldkey)
|
if (oldkey)
|
||||||
snprintf(tmp, sizeof(tmp), "%s;%s", oldkey, newkey);
|
snprintf(tmp, sizeof(tmp), "%s;%s", oldkey, newkey);
|
||||||
else
|
else
|
||||||
|
@ -2722,7 +2722,7 @@ static char *dundi_show_peers(struct ast_cli_entry *e, int cmd, struct ast_cli_a
|
||||||
AST_LIST_LOCK(&peers);
|
AST_LIST_LOCK(&peers);
|
||||||
ast_cli(a->fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status");
|
ast_cli(a->fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status");
|
||||||
AST_LIST_TRAVERSE(&peers, peer, list) {
|
AST_LIST_TRAVERSE(&peers, peer, list) {
|
||||||
char status[20];
|
char status[64];
|
||||||
int print_line = -1;
|
int print_line = -1;
|
||||||
char srch[2000];
|
char srch[2000];
|
||||||
|
|
||||||
|
|
|
@ -3005,7 +3005,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
|
||||||
if (do_include || do_exec) {
|
if (do_include || do_exec) {
|
||||||
if (c) {
|
if (c) {
|
||||||
char *cur2;
|
char *cur2;
|
||||||
char real_inclusion_name[256];
|
char real_inclusion_name[525];
|
||||||
|
|
||||||
/* Strip off leading and trailing "'s and <>'s */
|
/* Strip off leading and trailing "'s and <>'s */
|
||||||
while((*c == '<') || (*c == '>') || (*c == '\"')) c++;
|
while((*c == '<') || (*c == '>') || (*c == '\"')) c++;
|
||||||
|
|
|
@ -98,7 +98,7 @@ static int utf8decode (unsigned char **pp)
|
||||||
*/
|
*/
|
||||||
static char txqcheck (char *dir, char *queue, char subaddress, char *channel, char *callerid, int wait, int delay, int retries, int concurrent)
|
static char txqcheck (char *dir, char *queue, char subaddress, char *channel, char *callerid, int wait, int delay, int retries, int concurrent)
|
||||||
{
|
{
|
||||||
char ogname[100],
|
char ogname[300],
|
||||||
temp[100],
|
temp[100],
|
||||||
dirname[100],
|
dirname[100],
|
||||||
*p=NULL;
|
*p=NULL;
|
||||||
|
|
Loading…
Reference in New Issue