From 7ca6f85a4174088ffa583740c738797708520dad Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Fri, 9 Jul 2004 10:08:09 +0000 Subject: 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 --- app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app.c') diff --git a/app.c b/app.c index 813d35842..86ad5077c 100755 --- a/app.c +++ b/app.c @@ -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, ", "))) { -- cgit v1.2.3