changeset 550:adee87ebe853 trunk

[svn] Sanity checking inside vfs_() functions.
author nenolod
date Mon, 30 Jan 2006 05:44:27 -0800
parents 5a8f8c28871a
children 2879fec62150
files libaudacious/vfs_gnome.c libaudacious/vfs_stdio.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libaudacious/vfs_gnome.c	Sun Jan 29 14:17:45 2006 -0800
+++ b/libaudacious/vfs_gnome.c	Mon Jan 30 05:44:27 2006 -0800
@@ -48,6 +48,9 @@
     GnomeVFSOpenMode g_mode;
     gboolean truncate, append;
 
+    if (!path || !mode)
+	return NULL;
+
     file = g_new(VFSFile, 1);
 
     mode_to_gnome_vfs(mode, &g_mode, &truncate, &append);
--- a/libaudacious/vfs_stdio.c	Sun Jan 29 14:17:45 2006 -0800
+++ b/libaudacious/vfs_stdio.c	Mon Jan 30 05:44:27 2006 -0800
@@ -38,6 +38,9 @@
 {
     VFSFile *file;
 
+    if (!path || !mode)
+	return NULL;
+
     file = g_new(VFSFile, 1);
 
     file->handle = fopen(path, mode);