After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 78197 - gmessages.c calls g_convert() without checking result
gmessages.c calls g_convert() without checking result
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 79462 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-04-09 16:17 UTC by Owen Taylor
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2002-04-09 16:17:59 UTC
See bug 77341

static gchar*
strdup_convert (const gchar *string,
		const gchar *charset)
{
  if (!g_utf8_validate (string, -1, NULL))
    return g_strconcat ("[Invalid UTF-8] ", string, NULL);
  else
    return g_convert_with_fallback (string, -1, charset, "UTF-8", "?",
NULL, NULL, NULL);
}

Has problesm because g_convert_with_fallback() can fail even if string
is valid UTF-8, though the most common reason for this would be that
there is some problem with the system... e.g., that g_get_charset()
is not working correctly.
Comment 1 Owen Taylor 2002-05-07 15:35:34 UTC
*** Bug 79462 has been marked as a duplicate of this bug. ***
Comment 2 Owen Taylor 2002-05-07 16:10:19 UTC
*** Bug 78256 has been marked as a duplicate of this bug. ***
Comment 3 Owen Taylor 2002-05-13 21:22:28 UTC
Mon May 13 11:42:23 2002  Owen Taylor  <otaylor@redhat.com>

	* glib/gmessages.c (strdup_convert): If
	g_convert_with_fallback() fails, print the error
	message to stderr the first time, then return
	the original string. (#78197)