summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-11-09 20:47:10 +0000
committerRichard Hughes <richard@hughsie.com>2016-11-09 20:47:10 +0000
commit1c309839246900f73a203f84aa5380ea2746b360 (patch)
tree2962e94183bb6123f9a363604f15c3e548dea062
parentff79392430e7f76ddaca83420dc873444fe943cd (diff)
downloadappstream-glib-1c309839246900f73a203f84aa5380ea2746b360.tar.gz
Check the return value of the stat call
Found using Coverity.
-rw-r--r--libappstream-builder/asb-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c
index 01b4f04..4bb5e58 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);