summaryrefslogtreecommitdiff
path: root/accel-pptpd/extra
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2010-10-25 12:57:14 +0400
committerKozlov Dmitry <xeb@mail.ru>2010-10-25 12:57:14 +0400
commitf2a757b4e08fef2859dd7fc7bb4798d933e56783 (patch)
treeac3247e5fe095784f6a600485a9b001c276c2944 /accel-pptpd/extra
parent8c0d2ca4709fdbf429b8fd59fcec30f0d266dcde (diff)
downloadaccel-ppp-f2a757b4e08fef2859dd7fc7bb4798d933e56783.tar.gz
accel-ppp-f2a757b4e08fef2859dd7fc7bb4798d933e56783.zip
pppd_compat: fixed incorrect array size for environment variables
Diffstat (limited to 'accel-pptpd/extra')
-rw-r--r--accel-pptpd/extra/pppd_compat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c
index 9655269a..db46dd47 100644
--- a/accel-pptpd/extra/pppd_compat.c
+++ b/accel-pptpd/extra/pppd_compat.c
@@ -230,9 +230,9 @@ static void ev_ppp_finished(struct ppp_t *ppp)
char ipaddr[16];
char peer_ipaddr[16];
char peername[64];
- char connect_time[16];
- char bytes_sent[12];
- char bytes_rcvd[12];
+ char connect_time[24];
+ char bytes_sent[24];
+ char bytes_rcvd[24];
struct pppd_compat_pd_t *pd = find_pd(ppp);
if (!pd)
@@ -463,13 +463,13 @@ static void fill_argv(char **argv, struct ppp_t *ppp, char *path)
static void fill_env(char **env, struct pppd_compat_pd_t *pd)
{
- sprintf(env[0], "PEERNAME=%s", pd->ppp->username);
+ snprintf(env[0], 64, "PEERNAME=%s", pd->ppp->username);
if (pd->ppp->stop_time) {
- sprintf(env[1], "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
- sprintf(env[2], "BYTES_SENT=%u", pd->bytes_sent);
- sprintf(env[3], "BYTES_RCVD=%u", pd->bytes_rcvd);
+ snprintf(env[1], 24, "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
+ snprintf(env[2], 24, "BYTES_SENT=%u", pd->bytes_sent);
+ snprintf(env[3], 24, "BYTES_RCVD=%u", pd->bytes_rcvd);
}
}