Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-02-13 14:41:53 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-02-13 14:41:53 +0300
commit03ac74c1686c75614511450541296c74150cb066 (patch)
tree73d94fea4a360e3eec074673c5e434e0c170d7d9 /winsup/utils
parentcfdf224b823f3f249b9cda1a66df9d4adb2e445c (diff)
* cygpath.cc (do_pathconv): Fix potential crash.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/cygpath.cc10
2 files changed, 8 insertions, 6 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 01e7cd852..8b006f455 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-13 Ilguiz Latypov <ilatypov@infradead.org>
+
+ * cygpath.cc (do_pathconv): Fix potential crash.
+
2010-02-11 Corinna Vinschen <corinna@vinschen.de>
* getlocale.c (main): Rename local variable to avoid problems.
diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc
index 2b9fed419..4dbdaeff0 100644
--- a/winsup/utils/cygpath.cc
+++ b/winsup/utils/cygpath.cc
@@ -772,8 +772,6 @@ do_pathconv (char *filename)
buf = get_long_name (tmp = buf, len);
free (tmp);
}
- /* buf gets moved into the array so we have to set tmp for later
- freeing beforehand. */
tmp = buf;
if (strncmp (buf, "\\\\?\\", 4) == 0)
{
@@ -782,13 +780,13 @@ do_pathconv (char *filename)
len = 6;
if (strlen (buf) < MAX_PATH + len)
{
- buf += len;
+ tmp += len;
if (len == 6)
- *buf = '\\';
+ *tmp = '\\';
}
}
if (mixed_flag)
- convert_slashes (buf);
+ convert_slashes (tmp);
}
}
@@ -796,7 +794,7 @@ do_pathconv (char *filename)
if (buf2)
free (buf2);
if (buf)
- free (tmp);
+ free (buf);
}
static void