diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-06-11 04:44:25 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-06-11 04:44:25 +0800 |
commit | c6c4d95cb823d0f24ed36f37f021e6b89c6e2fd8 (patch) | |
tree | 219a77d11a4fb5c8bd905ea537d28e7bf8ed8f84 /e-util | |
parent | 5bc17ebb34149ace7d68352794bd7933655147b5 (diff) | |
download | gsoc2013-evolution-c6c4d95cb823d0f24ed36f37f021e6b89c6e2fd8.tar.gz gsoc2013-evolution-c6c4d95cb823d0f24ed36f37f021e6b89c6e2fd8.tar.zst gsoc2013-evolution-c6c4d95cb823d0f24ed36f37f021e6b89c6e2fd8.zip |
Stat the file to make sure it exists before trying to parse it using
2003-05-30 Jeffrey Stedfast <fejj@ximian.com>
* e-meta.c (meta_load): Stat the file to make sure it exists
before trying to parse it using xmlParseFile().
svn path=/trunk/; revision=21394
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 6 | ||||
-rw-r--r-- | e-util/e-meta.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 6ada021542..8a7bdf962b 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,5 +1,5 @@ -2003-06-04 Rodrigo Moya <rodrigo@ximian.com> +2003-05-30 Jeffrey Stedfast <fejj@ximian.com> - * e-component-listener.[ch]: use ORBit_small_listen/_unlisten instead - of Bonobo_Unknown_ping'ing the components. + * e-meta.c (meta_load): Stat the file to make sure it exists + before trying to parse it using xmlParseFile(). diff --git a/e-util/e-meta.c b/e-util/e-meta.c index 2b0dce5c30..a4c0ad562b 100644 --- a/e-util/e-meta.c +++ b/e-util/e-meta.c @@ -107,10 +107,14 @@ static int meta_load(EMeta *em) { struct _EMetaPrivate *p = em->priv; struct _meta_data *tail, *md; - xmlDocPtr doc; + xmlDocPtr doc = NULL; xmlNodePtr root, work; char *name, *val; - + struct stat st; + + if (stat (p->path, &st) == -1 || !S_ISREG (st.st_mode)) + return -1; + doc = xmlParseFile(p->path); if (doc == NULL) return -1; |