| 8329 | } |
| 8330 | |
| 8331 | bool cbm_path_within_root(const char *root_path, const char *abs_path) { |
| 8332 | if (!root_path || !abs_path) { |
| 8333 | return false; |
| 8334 | } |
| 8335 | char real_root[CBM_SZ_4K]; |
| 8336 | char real_file[CBM_SZ_4K]; |
| 8337 | if (resolve_canonical_path(root_path, real_root, sizeof(real_root)) && |
| 8338 | resolve_canonical_path(abs_path, real_file, sizeof(real_file))) { |
| 8339 | if (canonical_path_has_root(real_root, real_file)) { |
| 8340 | return true; |
| 8341 | } |
| 8342 | } |
| 8343 | return false; |
| 8344 | } |
| 8345 | |
| 8346 | static char *resolve_snippet_source(const char *root_path, const char *file_path, int start, |
| 8347 | int end, char **out_abs_path) { |
no test coverage detected