Module: kamailio
Branch: master
Commit: ecf5ce88a2de9a2f28b87e1f9a0303e59870c1f7
URL:
https://github.com/kamailio/kamailio/commit/ecf5ce88a2de9a2f28b87e1f9a0303e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-12T11:41:23+01:00
nat_traversal: init variables read from string
---
Modified: src/modules/nat_traversal/nat_traversal.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ecf5ce88a2de9a2f28b87e1f9a0303e…
Patch:
https://github.com/kamailio/kamailio/commit/ecf5ce88a2de9a2f28b87e1f9a0303e…
---
diff --git a/src/modules/nat_traversal/nat_traversal.c
b/src/modules/nat_traversal/nat_traversal.c
index b433cf234e4..4a27945a3e2 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -1724,10 +1724,12 @@ static void restore_keepalive_state(void)
res = fscanf(f, STATE_FILE_HEADER); // skip header
while(true) {
+ ll_1 = 0;
+ ll_2 = 0;
+ uri[0] = '\0';
+ socket[0] = '\0';
res = fscanf(f, "%63s %63s %" TIME_T_FMT " %" TIME_T_FMT, uri,
socket,
&ll_1, &ll_2);
- rtime = ll_1;
- stime = ll_2;
if(res == EOF) {
if(ferror(f))
LM_ERR("error while reading keepalive state file: %s\n",
@@ -1738,6 +1740,8 @@ static void restore_keepalive_state(void)
"entries.\n");
break;
} else {
+ rtime = ll_1;
+ stime = ll_2;
if(now > rtime && now > stime)
continue; // expired entry