| 8320 | } |
| 8321 | |
| 8322 | bool cbm_path_within_root(const char *root_path, const char *abs_path) { |
| 8323 | if (!root_path || !abs_path) { |
| 8324 | return false; |
| 8325 | } |
| 8326 | char real_root[CBM_SZ_4K]; |
| 8327 | char real_file[CBM_SZ_4K]; |
| 8328 | if (resolve_canonical_path(root_path, real_root, sizeof(real_root)) && |
| 8329 | resolve_canonical_path(abs_path, real_file, sizeof(real_file))) { |
| 8330 | if (canonical_path_has_root(real_root, real_file)) { |
| 8331 | return true; |
| 8332 | } |
| 8333 | } |
| 8334 | return false; |
| 8335 | } |
| 8336 | |
| 8337 | static char *resolve_snippet_source(const char *root_path, const char *file_path, int start, |
| 8338 | int end, char **out_abs_path) { |
no test coverage detected