diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-08-25 12:20:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-25 12:20:50 -0400 |
| commit | 0850b1722cbd5095aa6f6e307b9c1bac49228d53 (patch) | |
| tree | 3f5634b935981136f651c7bcc3f0dd48dbf0a61c /src/win32 | |
| parent | cc4f8bc65e7dfc6673b83645b2f323bf555088e8 (diff) | |
| parent | 4584660e11ee5fd6e9fb44b0d00bf7cb8df8edb4 (diff) | |
| download | libgit2-0850b1722cbd5095aa6f6e307b9c1bac49228d53.tar.gz | |
Merge pull request #5950 from boretrk/posixtest
open: input validation for empty segments in path
Diffstat (limited to 'src/win32')
| -rw-r--r-- | src/win32/posix_w32.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c index 0a8f2bee0..7fcc472e9 100644 --- a/src/win32/posix_w32.c +++ b/src/win32/posix_w32.c @@ -543,6 +543,13 @@ int p_open(const char *path, int flags, ...) mode_t mode = 0; struct open_opts opts = {0}; + #ifdef GIT_DEBUG_STRICT_OPEN + if (strstr(path, "//") != NULL) { + errno = EACCES; + return -1; + } + #endif + if (git_win32_path_from_utf8(wpath, path) < 0) return -1; |
