diff options
author | Richard Hughes <richard@hughsie.com> | 2017-02-21 10:46:08 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-02-21 10:46:10 +0000 |
commit | 72789b6ff59f5d1741d1cbc29e90bfa57079c514 (patch) | |
tree | 97577c6d48b075d7ef5e82ee101e9a9ce7ee36a2 /libappstream-glib/as-app-validate.c | |
parent | 21a921643fc77c5dae7b92a2566e90531cef3806 (diff) | |
download | appstream-glib-72789b6ff59f5d1741d1cbc29e90bfa57079c514.tar.gz |
Fail to validate if any release is in the future
Fixes: https://github.com/hughsie/appstream-glib/issues/153
Diffstat (limited to 'libappstream-glib/as-app-validate.c')
-rw-r--r-- | libappstream-glib/as-app-validate.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c index 6616ac2..8c67792 100644 --- a/libappstream-glib/as-app-validate.c +++ b/libappstream-glib/as-app-validate.c @@ -840,6 +840,13 @@ as_app_validate_release (AsApp *app, "<release> timestamp should be a UNIX time"); } + /* check the timestamp is not in the future */ + if (timestamp > (guint64) g_get_real_time () / G_USEC_PER_SEC) { + ai_app_validate_add (helper, + AS_PROBLEM_KIND_ATTRIBUTE_INVALID, + "<release> timestamp is in the future"); + } + /* for firmware, check urgency */ if (as_app_get_kind (app) == AS_APP_KIND_FIRMWARE && as_release_get_urgency (release) == AS_URGENCY_KIND_UNKNOWN) { |