Skip to content

Commit

Permalink
Merge pull request #843 from giuseppe/drop-invalid-path-check
Browse files Browse the repository at this point in the history
utils: drop check for invalid path
  • Loading branch information
flouthoc authored Jan 11, 2022
2 parents bc8d5d0 + 4cd65c3 commit 9f6d8e0
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,6 @@ crun_safe_ensure_at (bool do_open, bool dir, int dirfd, const char *dirpath,

npath = xstrdup (path);

it = npath + strlen (npath) - 1;
while (*it == '/' && it > npath && ((size_t) (it - npath)) > dirpath_len)
*it-- = '\0';
if (((size_t) (it - npath)) == dirpath_len)
return crun_make_error (err, 0, "invalid path `%s`", path);

cwd = dirfd;
cur = npath;
it = strchr (npath, '/');
Expand Down

0 comments on commit 9f6d8e0

Please sign in to comment.