[sound-juicer] Check for NULL string in sanitize_path



commit b47b716da8eafb2e28d1a416b00fdbc17d40bfff
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Wed Aug 22 12:04:16 2012 +0100

    Check for NULL string in sanitize_path
    
    sanitize_path is not NULL safe and passing it NULL indicates an error
    somewhere as you probably don't want empty path elements.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661646

 src/sj-extracting.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/sj-extracting.c b/src/sj-extracting.c
index 6b10757..77871d5 100644
--- a/src/sj-extracting.c
+++ b/src/sj-extracting.c
@@ -862,6 +862,8 @@ sanitize_path (const char* str, const char* filesystem_type)
   gchar *res = NULL;
   gchar *s;
 
+  g_return_val_if_fail (str != NULL, NULL);
+
   /* Skip leading periods, otherwise files disappear... */
   while (*str == '.')
     str++;



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