summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2006-11-20 21:51:27 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2006-11-20 21:51:27 +0000
commit4f37dd7ec5b637ea0c7405bcd51fd5b7d38b2c20 (patch)
treeede2b02d57cf8e6cc9f9b4b77d9090d129af373d
parente637b167beece90f4041cc6e1f7f3731dc2852f1 (diff)
downloadyelp-4f37dd7ec5b637ea0c7405bcd51fd5b7d38b2c20.tar.gz
Check the file exists and is valid before trying to read it (fixes bug
* src/yelp-io-channel.c: Check the file exists and is valid before trying to read it (fixes bug #371680)
-rw-r--r--ChangeLog4
-rw-r--r--src/yelp-io-channel.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a553ef91..5e93649a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2006-11-20 Don Scorgie <dscorgie@cvs.gnome.org>
+ * src/yelp-io-channel.c:
+ Check the file exists and is valid before trying
+ to read it (fixes bug #371680)
+
* src/yelp-gecko-services.cpp:
Fix printing ranges (bug #370618, Christian Persch)
diff --git a/src/yelp-io-channel.c b/src/yelp-io-channel.c
index d504f785..85f26d60 100644
--- a/src/yelp-io-channel.c
+++ b/src/yelp-io-channel.c
@@ -79,6 +79,10 @@ yelp_io_channel_new_file (gchar *file,
if (!file)
return NULL;
+ if (!g_file_test (file, G_FILE_TEST_EXISTS) ||
+ g_file_test (file, G_FILE_TEST_IS_DIR))
+ return NULL;
+
channel = g_new0(YelpIOChannel, 1);
iochannel = (GIOChannel *) channel;