[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src fileio.c
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] emacs/src fileio.c |
Date: |
Sat, 20 Dec 2008 15:17:29 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Jason Rumney <jasonr> 08/12/20 15:17:28
Modified files:
src : fileio.c
Log message:
(Fexpand_file_name): Do not allow ../ to go beyond the server name in
UNC paths.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/fileio.c?cvsroot=emacs&r1=1.642&r2=1.643
Patches:
Index: fileio.c
===================================================================
RCS file: /sources/emacs/emacs/src/fileio.c,v
retrieving revision 1.642
retrieving revision 1.643
diff -u -b -r1.642 -r1.643
--- fileio.c 14 Nov 2008 21:11:15 -0000 1.642
+++ fileio.c 20 Dec 2008 15:17:28 -0000 1.643
@@ -1323,8 +1323,18 @@
#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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/src fileio.c,
Jason Rumney <=