Fix stack overflow in ogs_pfcp_extract_node_id()

This commit is contained in:
shellwayxw
2025-04-09 01:13:01 -04:00
committed by Sukchan Lee
parent 726b588d76
commit 31d3f575d2

View File

@@ -194,7 +194,7 @@ ogs_pfcp_extract_node_id(ogs_pfcp_message_t *message,
goto done;
}
memcpy(node_id, tlv_node_id->data, tlv_node_id->len);
memcpy(node_id, tlv_node_id->data, ogs_min(tlv_node_id->len, sizeof(ogs_pfcp_node_id_t)));
if (node_id->type != OGS_PFCP_NODE_ID_IPV4 &&
node_id->type != OGS_PFCP_NODE_ID_IPV6 &&