Module: kamailio
Branch: master
Commit: a471d34d6162387a1427f5d0c5b3c6079a2b0bdc
URL:
https://github.com/kamailio/kamailio/commit/a471d34d6162387a1427f5d0c5b3c60…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-18T12:00:47+02:00
core: init res inside select_cfg_var()
---
Modified: src/core/cfg/cfg_select.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a471d34d6162387a1427f5d0c5b3c60…
Patch:
https://github.com/kamailio/kamailio/commit/a471d34d6162387a1427f5d0c5b3c60…
---
diff --git a/src/core/cfg/cfg_select.c b/src/core/cfg/cfg_select.c
index f948dd4ab4c..f3b2d681d3e 100644
--- a/src/core/cfg/cfg_select.c
+++ b/src/core/cfg/cfg_select.c
@@ -147,6 +147,9 @@ int select_cfg_var(str *res, select_t *s, struct sip_msg *msg)
int i;
static char buf[INT2STR_MAX_LEN];
+ res->s = 0;
+ res->len = 0;
+
if(msg == NULL) {
/* fixup call */
@@ -228,12 +231,7 @@ int select_cfg_var(str *res, select_t *s, struct sip_msg *msg)
break;
case CFG_VAR_STR:
- if(p) {
- memcpy(res, p, sizeof(str));
- } else {
- res->s = 0;
- res->len = 0;
- }
+ memcpy(res, p, sizeof(str));
break;
default: