diff options
author | Don Scorgie <dscorgie@src.gnome.org> | 2006-11-20 21:51:27 +0000 |
---|---|---|
committer | Don Scorgie <dscorgie@src.gnome.org> | 2006-11-20 21:51:27 +0000 |
commit | 4f37dd7ec5b637ea0c7405bcd51fd5b7d38b2c20 (patch) | |
tree | ede2b02d57cf8e6cc9f9b4b77d9090d129af373d | |
parent | e637b167beece90f4041cc6e1f7f3731dc2852f1 (diff) | |
download | yelp-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-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/yelp-io-channel.c | 4 |
2 files changed, 8 insertions, 0 deletions
@@ -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; |