Properties of the CALLS edge caller -> target (QNs below the project), or * NULL when there is no such edge. The caller frees the result. */
| 23254 | /* Properties of the CALLS edge caller -> target (QNs below the project), or |
| 23255 | * NULL when there is no such edge. The caller frees the result. */ |
| 23256 | static char *cpp_recv_calls(const CppRecvRun *r, const char *caller, const char *target) { |
| 23257 | char src_qn[512]; |
| 23258 | char tgt_qn[512]; |
| 23259 | snprintf(src_qn, sizeof(src_qn), "%s.%s", r->project, caller); |
| 23260 | snprintf(tgt_qn, sizeof(tgt_qn), "%s.%s", r->project, target); |
| 23261 | cbm_node_t src; |
| 23262 | cbm_node_t tgt; |
| 23263 | memset(&src, 0, sizeof(src)); |
| 23264 | memset(&tgt, 0, sizeof(tgt)); |
| 23265 | char *props = NULL; |
| 23266 | if (cbm_store_find_node_by_qn(r->s, r->project, src_qn, &src) == CBM_STORE_OK && |
| 23267 | cbm_store_find_node_by_qn(r->s, r->project, tgt_qn, &tgt) == CBM_STORE_OK) { |
| 23268 | cbm_edge_t *edges = NULL; |
| 23269 | int ec = 0; |
| 23270 | cbm_store_find_edges_by_source_type(r->s, src.id, "CALLS", &edges, &ec); |
| 23271 | for (int i = 0; i < ec && !props; i++) { |
| 23272 | if (edges[i].target_id == tgt.id) { |
| 23273 | props = strdup(edges[i].properties_json ? edges[i].properties_json : "{}"); |
| 23274 | } |
| 23275 | } |
| 23276 | if (edges) { |
| 23277 | cbm_store_free_edges(edges, ec); |
| 23278 | } |
| 23279 | } |
| 23280 | cbm_node_free_fields(&src); |
| 23281 | cbm_node_free_fields(&tgt); |
| 23282 | return props; |
| 23283 | } |
| 23284 | |
| 23285 | #define CPP_RECV_CALLER "pil.src.SecdCfgHandlerThread." |
| 23286 | #define CPP_RECV_CLASS "app.src.SecdManager." |
no test coverage detected