From: Matthias Clasen Date: Thu, 28 Apr 2005 20:47:51 +0000 (+0000) Subject: Warn and don't crash when meeting a trailing \\. (#301373, Benjamin Otte) X-Git-Tag: GLIB_2_7_0~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09b1a23fef7ae8451400ef5fe8fa2c6298bd894c;p=platform%2Fupstream%2Fglib.git Warn and don't crash when meeting a trailing \\. (#301373, Benjamin Otte) 2005-04-28 Matthias Clasen * glib/gstrfuncs.c (g_strcompress): Warn and don't crash when meeting a trailing \\. (#301373, Benjamin Otte) --- diff --git a/ChangeLog b/ChangeLog index d06f120..9184fd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-28 Matthias Clasen + + * glib/gstrfuncs.c (g_strcompress): Warn and don't crash + when meeting a trailing \\. (#301373, Benjamin Otte) + 2005-04-27 Tor Lillqvist * glib/gconvert.c (open_converter, g_convert_with_iconv): Don't diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d06f120..9184fd3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-04-28 Matthias Clasen + + * glib/gstrfuncs.c (g_strcompress): Warn and don't crash + when meeting a trailing \\. (#301373, Benjamin Otte) + 2005-04-27 Tor Lillqvist * glib/gconvert.c (open_converter, g_convert_with_iconv): Don't diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index d06f120..9184fd3 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-04-28 Matthias Clasen + + * glib/gstrfuncs.c (g_strcompress): Warn and don't crash + when meeting a trailing \\. (#301373, Benjamin Otte) + 2005-04-27 Tor Lillqvist * glib/gconvert.c (open_converter, g_convert_with_iconv): Don't diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d06f120..9184fd3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-04-28 Matthias Clasen + + * glib/gstrfuncs.c (g_strcompress): Warn and don't crash + when meeting a trailing \\. (#301373, Benjamin Otte) + 2005-04-27 Tor Lillqvist * glib/gconvert.c (open_converter, g_convert_with_iconv): Don't diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 8078988..3574f97 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -1966,6 +1966,9 @@ g_strcompress (const gchar *source) p++; switch (*p) { + case '\0': + g_warning ("g_strcompress: trailing \\"); + goto out; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': *q = 0; @@ -2002,6 +2005,7 @@ g_strcompress (const gchar *source) *q++ = *p; p++; } +out: *q = 0; return dest;