[Win32] Fix corner case bug when environment variable value is exactly one

2005-03-23  Tor Lillqvist  <tml@novell.com>

	* glib/gutils.c (g_getenv): [Win32] Fix corner case bug when
	environment variable value is exactly one character.
This commit is contained in:
Tor Lillqvist 2005-03-23 14:53:35 +00:00 committed by Tor Lillqvist
parent 4635159309
commit 6e51f47e13
5 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-03-23 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (g_getenv): [Win32] Fix corner case bug when
environment variable value is exactly one character.
2005-03-21 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols: Add g_try_malloc0

View File

@ -1,3 +1,8 @@
2005-03-23 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (g_getenv): [Win32] Fix corner case bug when
environment variable value is exactly one character.
2005-03-21 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols: Add g_try_malloc0

View File

@ -1,3 +1,8 @@
2005-03-23 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (g_getenv): [Win32] Fix corner case bug when
environment variable value is exactly one character.
2005-03-21 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols: Add g_try_malloc0

View File

@ -1,3 +1,8 @@
2005-03-23 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (g_getenv): [Win32] Fix corner case bug when
environment variable value is exactly one character.
2005-03-21 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols: Add g_try_malloc0

View File

@ -1009,6 +1009,8 @@ g_getenv (const gchar *variable)
g_free (wname);
return NULL;
}
else if (len == 1)
len = 2;
wvalue = g_new (wchar_t, len);
@ -1060,6 +1062,8 @@ g_getenv (const gchar *variable)
g_free (cpname);
return NULL;
}
else if (len == 1)
len = 2;
cpvalue = g_new (gchar, len);