aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_minivm.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-09 20:07:59 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-09 20:07:59 +0000
commitba8c937c7e2c59d4996d9f6083a448d95c924f01 (patch)
treeae0f784ef7a7f6def263ead1607ce0f2ba18eb32 /apps/app_minivm.c
parent053dc62d161266834345d22786355fde78d11332 (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: http://svn.digium.com/svn/asterisk/trunk@78829 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_minivm.c')
-rw-r--r--apps/app_minivm.c4
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: