diff options
author | Richard Hughes <richard@hughsie.com> | 2016-11-09 20:47:10 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-01-17 10:36:20 +0000 |
commit | 2f94805994e9dea9bcc60e3fd1c7d3b5f226d755 (patch) | |
tree | 2a0919e5f58c55c1ee4b009e82c6e97b9f4a1039 | |
parent | 4b3dcc19d7577920c6bdb6dae089f9a7127789bd (diff) | |
download | appstream-glib-2f94805994e9dea9bcc60e3fd1c7d3b5f226d755.tar.gz |
Check the return value of the stat call
Found using Coverity.
-rw-r--r-- | libappstream-builder/asb-utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c index 38b123a..6615711 100644 --- a/libappstream-builder/asb-utils.c +++ b/libappstream-builder/asb-utils.c @@ -435,7 +435,8 @@ asb_utils_write_archive (const gchar *filename, tmp = g_ptr_array_index (files, i); filename_full = g_build_filename (path_orig, tmp, NULL); - stat (filename_full, &st); + if (stat (filename_full, &st) != 0) + continue; entry = archive_entry_new (); archive_entry_set_pathname (entry, tmp); archive_entry_set_size (entry, st.st_size); |