More strcpy / snprintf as part of rgagnon's audit (bug #2004)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-07-09 10:08:09 +00:00
parent 069d045513
commit 7ca6f85a41
8 changed files with 32 additions and 27 deletions

4
app.c
View File

@@ -157,7 +157,7 @@ int ast_app_has_voicemail(const char *mailbox)
if (ast_strlen_zero(mailbox))
return 0;
if (strchr(mailbox, ',')) {
strncpy(tmp, mailbox, sizeof(tmp));
strncpy(tmp, mailbox, sizeof(tmp) - 1);
mb = tmp;
ret = 0;
while((cur = strsep(&mb, ","))) {
@@ -207,7 +207,7 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
return 0;
if (strchr(mailbox, ',')) {
int tmpnew, tmpold;
strncpy(tmp, mailbox, sizeof(tmp));
strncpy(tmp, mailbox, sizeof(tmp) - 1);
mb = tmp;
ret = 0;
while((cur = strsep(&mb, ", "))) {