aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:57:44 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:57:44 +0000
commitd61c17b5b2338a17d82b326f710d303410bbd4ef (patch)
treee6a3b371ced8a1c4f07635878b88ba6faba0881e /apps
parentf9c5cd25b64ee52d84a8b4d4dbcc297b81304eb8 (diff)
Merged revisions 106553 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r106553 | tilghman | 2008-03-07 00:54:47 -0600 (Fri, 07 Mar 2008) | 14 lines Merged revisions 106552 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines Safely use the strncat() function. (closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@106554 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c2
-rw-r--r--apps/app_rpt.c4
-rw-r--r--apps/app_speech_utils.c2
-rw-r--r--apps/app_voicemail.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index e0377d35f..0bf676891 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -682,7 +682,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
continue;
strcpy(peer_name, "spy-");
- strncat(peer_name, peer->name, AST_NAME_STRLEN);
+ strncat(peer_name, peer->name, AST_NAME_STRLEN - 4 - 1);
ptr = strchr(peer_name, '/');
*ptr++ = '\0';
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index f703aaec0..0957af0ea 100644
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -3321,7 +3321,7 @@ static int function_macro(struct rpt *myrpt, char *param, char *digitbuf, int co
return DC_ERROR;
}
myrpt->macrotimer = MACROTIME;
- strncat(myrpt->macrobuf, val, sizeof(myrpt->macrobuf) - 1);
+ strncat(myrpt->macrobuf, val, sizeof(myrpt->macrobuf) - strlen(myrpt->macrobuf) - 1);
rpt_mutex_unlock(&myrpt->lock);
return DC_COMPLETE;
}
@@ -3369,7 +3369,7 @@ static int function_gosub(struct rpt *myrpt, char *param, char *digitbuf, int co
return DC_ERROR;
}
myrpt->gosubtimer = GOSUBTIME;
- strncat(myrpt->gosubbuf, val, sizeof(myrpt->gosubbuf) - 1);
+ strncat(myrpt->gosubbuf, val, sizeof(myrpt->gosubbuf) - strlen(myrpt->gosubbuf) - 1);
rpt_mutex_unlock(&myrpt->lock);
return DC_COMPLETE;
}
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 2445955f4..221d2eb5c 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -696,7 +696,7 @@ static int speech_background(struct ast_channel *chan, void *data)
}
time(&start);
snprintf(tmp, sizeof(tmp), "%c", f->subclass);
- strncat(dtmf, tmp, sizeof(dtmf));
+ strncat(dtmf, tmp, sizeof(dtmf) - strlen(dtmf) - 1);
/* If the maximum length of the DTMF has been reached, stop now */
if (max_dtmf_len && strlen(dtmf) == max_dtmf_len)
done = 1;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 92e3859af..d26ad4d37 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4085,8 +4085,8 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
make_file(msgfile, sizeof(msgfile), curdir, curmsg);
strcpy(textfile, msgfile);
strcpy(backup, msgfile);
- strncat(textfile, ".txt", sizeof(textfile) - 1);
- strncat(backup, "-bak", sizeof(backup) - 1);
+ strncat(textfile, ".txt", sizeof(textfile) - strlen(textfile) - 1);
+ strncat(backup, "-bak", sizeof(backup) - strlen(backup) - 1);
msg_cfg = ast_config_load(textfile, config_flags);