diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-08-09 20:07:59 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-08-09 20:07:59 +0000 |
commit | dc7af7d5fe1c55b97bbbef65ea10160ea0b718a4 (patch) | |
tree | ae0f784ef7a7f6def263ead1607ce0f2ba18eb32 /apps/app_minivm.c | |
parent | 62f661484ba8b7dd100817b442fce9813d796e22 (diff) |
Don't use strncpy for moving a chunk of memory to another that is overlapping.
This was found by running Asterisk under valgrind.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_minivm.c')
-rw-r--r-- | apps/app_minivm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c index 14729c8d1..a868bac83 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -2275,11 +2275,11 @@ static char *message_template_parse_emailbody(const char *configuration) int len = strlen("\n"); switch (tmpwrite[1]) { case 'n': - strncpy(tmpwrite+len, tmpwrite+2, strlen(tmpwrite+2)+1); + memmove(tmpwrite + len, tmpwrite + 2, strlen(tmpwrite + 2) + 1); strncpy(tmpwrite, "\n", len); break; case 't': - strncpy(tmpwrite+len, tmpwrite+2, strlen(tmpwrite+2)+1); + memmove(tmpwrite + len, tmpwrite + 2, strlen(tmpwrite + 2) + 1); strncpy(tmpwrite, "\t", len); break; default: |