Minimum check for directory traversal. Returns nonzero if it is safe. */
| 498 | /* Minimum check for directory traversal. Returns nonzero if it is |
| 499 | safe. */ |
| 500 | static int check_path(const char *path) { |
| 501 | /* We don't like '\' in url. */ |
| 502 | return path[0] && path[0] == '/' && strchr(path, '\\') == NULL && |
| 503 | strstr(path, "/../") == NULL && strstr(path, "/./") == NULL && |
| 504 | !ends_with(path, "/..") && !ends_with(path, "/."); |
| 505 | } |
| 506 | |
| 507 | |
| 508 | static int h2_fdpack(str *data) |
no test coverage detected