[glib] Add some argument checks to filename conversion functions



commit f966a0af9ac5524b26917b266abcbbac890c58e0
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 14 19:52:19 2011 -0400

    Add some argument checks to filename conversion functions

 glib/gconvert.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glib/gconvert.c b/glib/gconvert.c
index 609a800..fd669aa 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -1469,6 +1469,8 @@ g_filename_to_utf8 (const gchar *opsysstring,
 {
   const gchar *charset;
 
+  g_return_val_if_fail (opsysstring != NULL, NULL);
+
   if (get_filename_charset (&charset))
     return strdup_len (opsysstring, len, bytes_read, bytes_written, error);
   else
@@ -1494,6 +1496,8 @@ g_filename_to_utf8 (const gchar *opsysstring,
 {
   const gchar *charset;
 
+  g_return_val_if_fail (opsysstring != NULL, NULL);
+
   if (g_get_charset (&charset))
     return strdup_len (opsysstring, len, bytes_read, bytes_written, error);
   else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]