mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 18:26:19 +01:00
Prevent segfaults on long paths. (#447935, Robby Griffin)
2007-06-17 Matthias Clasen <mclasen@redhat.com> * glib/gutils (g_get_current_dir): Prevent segfaults on long paths. (#447935, Robby Griffin) svn path=/trunk/; revision=5574
This commit is contained in:
parent
3bbb4d6dbd
commit
7a6d2233e4
@ -1,3 +1,8 @@
|
|||||||
|
2007-06-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gutils (g_get_current_dir): Prevent segfaults on
|
||||||
|
long paths. (#447935, Robby Griffin)
|
||||||
|
|
||||||
2007-06-17 Behdad Esfahbod <behdad@gnome.org>
|
2007-06-17 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
* glib/gdataset.c (g_quark_from_string),
|
* glib/gdataset.c (g_quark_from_string),
|
||||||
@ -16,7 +21,7 @@
|
|||||||
called. (#447583)
|
called. (#447583)
|
||||||
|
|
||||||
* glib/gthread.c (g_static_mutex_free): Clarified comment to
|
* glib/gthread.c (g_static_mutex_free): Clarified comment to
|
||||||
remind myself, tha calling g_static_mutex_free() before
|
remind myself, that calling g_static_mutex_free() before
|
||||||
g_thread_init() is safe.
|
g_thread_init() is safe.
|
||||||
|
|
||||||
2007-06-15 Cody Russell <bratsche@gnome.org>
|
2007-06-15 Cody Russell <bratsche@gnome.org>
|
||||||
|
@ -964,6 +964,7 @@ g_get_current_dir (void)
|
|||||||
#else /* !sun || !HAVE_GETCWD */
|
#else /* !sun || !HAVE_GETCWD */
|
||||||
while (max_len < G_MAXULONG / 2)
|
while (max_len < G_MAXULONG / 2)
|
||||||
{
|
{
|
||||||
|
g_free (buffer);
|
||||||
buffer = g_new (gchar, max_len + 1);
|
buffer = g_new (gchar, max_len + 1);
|
||||||
*buffer = 0;
|
*buffer = 0;
|
||||||
dir = getcwd (buffer, max_len);
|
dir = getcwd (buffer, max_len);
|
||||||
@ -971,7 +972,6 @@ g_get_current_dir (void)
|
|||||||
if (dir || errno != ERANGE)
|
if (dir || errno != ERANGE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
g_free (buffer);
|
|
||||||
max_len *= 2;
|
max_len *= 2;
|
||||||
}
|
}
|
||||||
#endif /* !sun || !HAVE_GETCWD */
|
#endif /* !sun || !HAVE_GETCWD */
|
||||||
|
Loading…
Reference in New Issue
Block a user