| 8264 | } |
| 8265 | |
| 8266 | bool cbm_path_within_root(const char *root_path, const char *abs_path) { |
| 8267 | if (!root_path || !abs_path) { |
| 8268 | return false; |
| 8269 | } |
| 8270 | char real_root[CBM_SZ_4K]; |
| 8271 | char real_file[CBM_SZ_4K]; |
| 8272 | if (resolve_canonical_path(root_path, real_root, sizeof(real_root)) && |
| 8273 | resolve_canonical_path(abs_path, real_file, sizeof(real_file))) { |
| 8274 | if (canonical_path_has_root(real_root, real_file)) { |
| 8275 | return true; |
| 8276 | } |
| 8277 | } |
| 8278 | return false; |
| 8279 | } |
| 8280 | |
| 8281 | static char *resolve_snippet_source(const char *root_path, const char *file_path, int start, |
| 8282 | int end, char **out_abs_path) { |
no test coverage detected