diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2018-02-12 00:29:32 -0800 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-12 13:54:29 +0000 |
commit | 6ed65fec8e5d268bd8a45e93942d7454516e89e7 (patch) | |
tree | 6a9d95ebb4b3e8b458fd5e4cc8f264c5440dd05e | |
parent | 6e689bf06f819f664b1dbccd681b07694a53a062 (diff) | |
download | flatpak-6ed65fec8e5d268bd8a45e93942d7454516e89e7.tar.gz |
build-export: Fix use of uninitialized memory
This fixes build-export so that it doesn't try to use uninitialized
memory in a timestamp object when creating appstream data. Before the
--timestamp option existed, a timestamp of 0 was used, so fall back to
that. Also, update a relevant comment.
Closes: #1408
Approved by: alexlarsson
-rw-r--r-- | app/flatpak-builtins-build-export.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c index 5f549aaa..10f45031 100644 --- a/app/flatpak-builtins-build-export.c +++ b/app/flatpak-builtins-build-export.c @@ -897,7 +897,7 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable, metadata_dict_v = g_variant_ref_sink (g_variant_dict_end (&metadata_dict)); - /* required for the metadata and the AppStream commits */ + /* The timestamp is used for the commit metadata and AppStream data */ if (opt_timestamp != NULL) { if (!g_time_val_from_iso8601 (opt_timestamp, &ts)) @@ -960,7 +960,7 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable, if (opt_update_appstream && !flatpak_repo_generate_appstream (repo, (const char **) opt_gpg_key_ids, opt_gpg_homedir, - ts.tv_sec, cancellable, error)) + (opt_timestamp != NULL) ? ts.tv_sec : 0, cancellable, error)) return FALSE; if (!opt_no_update_summary && |