Module: kamailio
Branch: master
Commit: 2394c0a97387efefde6a6784e09e02f3ff8a841c
URL:
https://github.com/kamailio/kamailio/commit/2394c0a97387efefde6a6784e09e02f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2020-05-12T16:14:39+02:00
msrp: use ctime_r() for a safer multi-thread usage
---
Modified: src/modules/msrp/msrp_cmap.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2394c0a97387efefde6a6784e09e02f…
Patch:
https://github.com/kamailio/kamailio/commit/2394c0a97387efefde6a6784e09e02f…
---
diff --git a/src/modules/msrp/msrp_cmap.c b/src/modules/msrp/msrp_cmap.c
index 0390173f91..9764c0903f 100644
--- a/src/modules/msrp/msrp_cmap.c
+++ b/src/modules/msrp/msrp_cmap.c
@@ -421,6 +421,7 @@ static void msrp_cmap_rpc_list(rpc_t* rpc, void* ctx)
msrp_citem_t *it;
int i;
int n;
+ char t_buf[26] = {0};
str edate;
if(_msrp_cmap_head==NULL)
@@ -457,7 +458,8 @@ static void msrp_cmap_rpc_list(rpc_t* rpc, void* ctx)
lock_release(&_msrp_cmap_head->cslots[i].lock);
return;
}
- edate.s = ctime(&it->expires);
+ ctime_r(&it->expires, t_buf);
+ edate.s = t_buf;
edate.len = 24;
if(rpc->struct_add(vh, "dSSSSSdd",
"CITEMID", it->citemid,