summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-tag.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-09-12 12:40:20 +0100
committerRichard Hughes <richard@hughsie.com>2014-09-12 12:40:20 +0100
commite64674b3b51f3358bec61e2fcfa2c47b78d881ea (patch)
treece0e13ab62b8a8812c2f8e1a0dd43bceabe9ed8b /libappstream-glib/as-tag.c
parent8dd4f4665367ddb930ce31d6d848598c58d6b8ab (diff)
downloadappstream-glib-e64674b3b51f3358bec61e2fcfa2c47b78d881ea.tar.gz
Do not crash when doing as_tag_from_string(NULL)
Diffstat (limited to 'libappstream-glib/as-tag.c')
-rw-r--r--libappstream-glib/as-tag.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libappstream-glib/as-tag.c b/libappstream-glib/as-tag.c
index 57450de..232e967 100644
--- a/libappstream-glib/as-tag.c
+++ b/libappstream-glib/as-tag.c
@@ -79,6 +79,10 @@ as_tag_from_string_full (const gchar *tag, AsTagFlags flags)
#endif
AsTag etag = AS_TAG_UNKNOWN;
+ /* invalid */
+ if (tag == NULL)
+ return AS_TAG_UNKNOWN;
+
#ifdef HAVE_GPERF
/* use a perfect hash */
ky = as_tag_from_gperf (tag, strlen (tag));