Module: kamailio
Branch: master
Commit: 88b8ec8f2021fcc53289544102e5c5020885f8c3
URL:
https://github.com/kamailio/kamailio/commit/88b8ec8f2021fcc53289544102e5c50…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-11-18T18:24:36+01:00
acc_radius: use snprintf() instead of sprintf()
---
Modified: src/modules/acc_radius/acc_radius_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/88b8ec8f2021fcc53289544102e5c50…
Patch:
https://github.com/kamailio/kamailio/commit/88b8ec8f2021fcc53289544102e5c50…
---
diff --git a/src/modules/acc_radius/acc_radius_mod.c
b/src/modules/acc_radius/acc_radius_mod.c
index b4e74c6656..41e70c73fb 100644
--- a/src/modules/acc_radius/acc_radius_mod.c
+++ b/src/modules/acc_radius/acc_radius_mod.c
@@ -361,7 +361,7 @@ int acc_radius_send_request(struct sip_msg *req, acc_info_t *inf)
tsecmicro = inf->env->tv.tv_sec
+ ((double)inf->env->tv.tv_usec / 1000000.0);
//radius client doesn t support double so convert it
- sprintf(smicrosec, "%17.6f", tsecmicro);
+ snprintf(smicrosec, 18, "%17.6f", tsecmicro);
ADD_RAD_AVPAIR(RA_TIME_STAMP, &smicrosec, -1);
} else {
av_type = (uint32_t)inf->env->ts;