Module: kamailio
Branch: master
Commit: 66350831872370a5a06f2ee44e8609ceb0164592
URL:
https://github.com/kamailio/kamailio/commit/66350831872370a5a06f2ee44e8609c…
Author: Eik Rentzow <rentzow(a)gmx.de>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-11-19T15:51:32+01:00
siputils: generated icid-value too short
- icid-value is only 17 charaters and not unique
- Re-parsing of generated PCV with icid-generated is 2 characters too short,
cutting generated-by value or creating false warning
---
Modified: src/modules/siputils/chargingvector.c
---
Diff:
https://github.com/kamailio/kamailio/commit/66350831872370a5a06f2ee44e8609c…
Patch:
https://github.com/kamailio/kamailio/commit/66350831872370a5a06f2ee44e8609c…
---
diff --git a/src/modules/siputils/chargingvector.c
b/src/modules/siputils/chargingvector.c
index c49e3ebf1a2..110f06be77d 100644
--- a/src/modules/siputils/chargingvector.c
+++ b/src/modules/siputils/chargingvector.c
@@ -147,7 +147,7 @@ static void sip_generate_charging_vector(char *pcv, const unsigned int
maxsize)
const char *endptr = ptr + maxsize - 1;
for(int i = 0; i < len && ptr < endptr; i++) {
- ptr += (snprintf(ptr, 3, "%02X", newConferenceIdentifier[i]) - 1);
+ ptr += snprintf(ptr, 3, "%02X", newConferenceIdentifier[i]);
}
}
@@ -258,6 +258,7 @@ static int sip_get_charging_vector(
}
sip_initialize_pcv_buffers();
+ _siputils_pcv_status = PCV_NONE;
for(hf = msg->headers; hf; hf = hf->next) {
if(hf->name.s[0] != 'P') {
@@ -298,7 +299,6 @@ static int sip_get_charging_vector(
}
}
LM_DBG("No valid P-Charging-Vector header found.\n");
- _siputils_pcv_status = PCV_NONE;
*hf_pcv = NULL;
return 1;
}
@@ -482,7 +482,7 @@ int sip_handle_pcv(struct sip_msg *msg, char *flags, char *str2)
/* if generated and added, copy buffer and reparse it */
sip_initialize_pcv_buffers();
- _siputils_pcv.len = body_len - CRLF_LEN;
+ _siputils_pcv.len = body_len;
memcpy(_siputils_pcv.s, pcv_body, _siputils_pcv.len);
if(sip_parse_charging_vector(
_siputils_pcv_buf, sizeof(_siputils_pcv_buf))) {