mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-05-27 23:56:04 -07:00
(Fexpand_file_name): Do not allow ../ to go beyond the server name in
UNC paths.
This commit is contained in:
parent
1e9340df3d
commit
972ed2462a
1 changed files with 10 additions and 0 deletions
10
src/fileio.c
10
src/fileio.c
|
|
@ -1323,8 +1323,18 @@ filesystem tree, not (expand-file-name ".." dirname). */)
|
|||
#endif
|
||||
&& (IS_DIRECTORY_SEP (p[3]) || p[3] == 0))
|
||||
{
|
||||
#ifdef WINDOWSNT
|
||||
unsigned char *prev_o = o;
|
||||
#endif
|
||||
while (o != target && (--o) && !IS_DIRECTORY_SEP (*o))
|
||||
;
|
||||
#ifdef WINDOWSNT
|
||||
/* Don't go below server level in UNC filenames. */
|
||||
if (o == target + 1 && IS_DIRECTORY_SEP (*o)
|
||||
&& IS_DIRECTORY_SEP (*target))
|
||||
o = prev_o;
|
||||
else
|
||||
#endif
|
||||
/* Keep initial / only if this is the whole name. */
|
||||
if (o == target && IS_ANY_SEP (*o) && p[3] == 0)
|
||||
++o;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue