diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-07-29 23:08:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-07-29 23:08:33 -0700 |
commit | 768aeab3232cd3077ffff579ff2d59441c6968ef (patch) | |
tree | b6e9ee045fb84e1e4f2870db1f6a0047d26ca8f1 /safepath.c | |
parent | 2f27d6c386daff041017b7aaec51d0e50e603a8e (diff) | |
download | safepath-768aeab3232cd3077ffff579ff2d59441c6968ef.tar.gz safepath-768aeab3232cd3077ffff579ff2d59441c6968ef.tar.bz2 safepath-768aeab3232cd3077ffff579ff2d59441c6968ef.zip |
Fix link grafting bug.
Reported by Travis Ormandy in comp.unix.programmer.
* safepath.c (safepath_check): In the case when
we are combining a relative symlink target with
remaining material from the path, there is a forgotten
1 offset which causes the slash between them to
be deleted.
Diffstat (limited to 'safepath.c')
-rw-r--r-- | safepath.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -470,7 +470,7 @@ int safepath_check(const char *name) memcpy(resolved, copy, pos); strcpy(resolved + pos, link); resolved[pos + len] = '/'; - strcpy(resolved + pos + len, copy + nxslash + 1); + strcpy(resolved + pos + len + 1, copy + nxslash + 1); free(copy); copy = resolved; continue; |