aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_adsi.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-14 13:57:15 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-14 13:57:15 +0000
commit5d8654361451b217b1fc604f449554e74a11b70b (patch)
tree30a1118273807f5c6ba0e3ca611ab0c6a160fa3b /res/res_adsi.c
parent3aea726c3943cf31d2d90c194d1e126891b1481d (diff)
Merge remaining audit patch (save dlfcn.c)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3436 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_adsi.c')
-rwxr-xr-xres/res_adsi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/res/res_adsi.c b/res/res_adsi.c
index 1e198b7ae..2ee440e6a 100755
--- a/res/res_adsi.c
+++ b/res/res_adsi.c
@@ -1006,13 +1006,13 @@ static void init_state(void)
for (x=0;x<ADSI_MAX_INTRO;x++)
aligns[x] = ADSI_JUST_CENT;
- strcpy(intro[0], "Welcome to the");
- strcpy(intro[1], "Asterisk");
- strcpy(intro[2], "Open Source PBX");
+ strncpy(intro[0], "Welcome to the", sizeof(intro[0]) - 1);
+ strncpy(intro[1], "Asterisk", sizeof(intro[1]) - 1);
+ strncpy(intro[2], "Open Source PBX", sizeof(intro[2]) - 1);
total = 3;
speeds = 0;
for (x=3;x<ADSI_MAX_INTRO;x++)
- strcpy(intro[x], "");
+ intro[x][0] = '\0';
memset(speeddial, 0, sizeof(speeddial));
alignment = ADSI_JUST_CENT;
}
@@ -1034,7 +1034,8 @@ static void adsi_load(void)
else if (!strcasecmp(v->name, "greeting")) {
if (x < ADSI_MAX_INTRO) {
aligns[x] = alignment;
- strncpy(intro[x], v->value, 20);
+ strncpy(intro[x], v->value, sizeof(intro[x]) - 1);
+ intro[x][sizeof(intro[x]) - 1] = '\0';
x++;
}
} else if (!strcasecmp(v->name, "maxretries")) {
@@ -1056,7 +1057,7 @@ static void adsi_load(void)
sname = name;
if (x < ADSI_MAX_SPEED_DIAL) {
/* Up to 20 digits */
- strncpy(speeddial[x][0], v->name, 20);
+ strncpy(speeddial[x][0], v->name, sizeof(speeddial[x][0]) - 1);
strncpy(speeddial[x][1], name, 18);
strncpy(speeddial[x][2], sname, 7);
x++;