aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_rpt.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:36:33 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-07 06:36:33 +0000
commit2d66183adf20c8b3898a3bfc97627d55dff7891f (patch)
treee1d83f46856427c7e9df46336f418ec059a92c57 /apps/app_rpt.c
parent6623be8860eb9337ebbc3a5a32388270fac5628b (diff)
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.4@106552 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_rpt.c')
-rw-r--r--apps/app_rpt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index e7f7b003c..292dfc6f6 100644
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -2427,7 +2427,7 @@ static int rpt_do_fun(int fd, int argc, char *argv[])
}
if(!busy){
myrpt->macrotimer = MACROTIME;
- strncat(myrpt->macrobuf,argv[3],MAXMACRO - 1);
+ strncat(myrpt->macrobuf, argv[3], MAXMACRO - strlen(myrpt->macrobuf) - 1);
}
rpt_mutex_unlock(&myrpt->lock);
}
@@ -5090,7 +5090,7 @@ int i;
return DC_ERROR;
}
myrpt->macrotimer = MACROTIME;
- strncat(myrpt->macrobuf,val,MAXMACRO - 1);
+ strncat(myrpt->macrobuf, val, MAXMACRO - strlen(myrpt->macrobuf) - 1);
rpt_mutex_unlock(&myrpt->lock);
return DC_COMPLETE;
}
@@ -8749,7 +8749,7 @@ static void do_scheduler(struct rpt *myrpt)
return; /* Macro buffer full */
}
myrpt->macrotimer = MACROTIME;
- strncat(myrpt->macrobuf,val,MAXMACRO - 1);
+ strncat(myrpt->macrobuf,val,MAXMACRO - strlen(myrpt->macrobuf) - 1);
}
else{
ast_log(LOG_WARNING,"Malformed scheduler entry in rpt.conf: %s = %s\n",