fixup: Volte support

Fixes uninitialized memory, found by valgrind.
This commit is contained in:
Andreas Eversberg 2024-05-15 17:01:30 +02:00
parent 1eb1d32f40
commit 717b64fb17
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ struct mnl_socket;
struct xfrm_algobuf {
struct xfrm_algo algo;
uint8_t buf[128];
uint8_t buf[160];
};
struct mnl_socket *xfrm_init_mnl_socket(void);

View File

@ -235,6 +235,7 @@ static pj_status_t volte_set_xfrm(struct ast_sip_transport_state *transport_stat
ast_log(LOG_ERROR, "Given 'ealg' not supported.\n");
return -EINVAL;
}
memset(&auth_algo, 0, sizeof(auth_algo));
strcpy(auth_algo.algo.alg_name, g_ipsec_alg[i].kernel_name);
switch (i) {
case 0:
@ -247,6 +248,7 @@ static pj_status_t volte_set_xfrm(struct ast_sip_transport_state *transport_stat
auth_algo.algo.alg_key_len = 160;
break;
}
memset(&ciph_algo, 0, sizeof(ciph_algo));
strcpy(ciph_algo.algo.alg_name, g_ipsec_ealg[j].kernel_name);
switch (j) {
case 0:
@ -645,7 +647,9 @@ pj_status_t volte_get_security_server(struct ast_sip_transport_state *transport_
memset(sec, 0, sizeof(*sec));
pj_scan_init(&scanner, sec_hdr->hvalue.ptr, sec_hdr->hvalue.slen, 0, &on_syntax_error);
/* NOTE: The string to parse must be null-terminated. */
pj_scan_init(&scanner, transport_state->volte.security_server, strlen(transport_state->volte.security_server),
0, &on_syntax_error);
for (;;) {
pj_str_t name, value;