summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-06-01 10:35:01 +0100
committerRichard Hughes <richard@hughsie.com>2014-06-01 10:35:37 +0100
commitca1ddc138a0782f5b569f81f865a59ce23a4b161 (patch)
tree849d7cff071ab8f67af615b9e31da910db2633ba
parent40bb4a7e452d284f58df2848b2ba744d0254b230 (diff)
downloadappstream-glib-ca1ddc138a0782f5b569f81f865a59ce23a4b161.tar.gz
Fix a crash when we try to validate <p></p>
-rw-r--r--libappstream-glib/as-app-validate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-validate.c b/libappstream-glib/as-app-validate.c
index 07b8013..67e2516 100644
--- a/libappstream-glib/as-app-validate.c
+++ b/libappstream-glib/as-app-validate.c
@@ -136,6 +136,14 @@ as_app_validate_description_para (const gchar *text, AsAppValidateHelper *helper
guint length_para_min = 50;
guint str_len;
+ /* empty */
+ if (text == NULL) {
+ ai_app_validate_add (helper->probs,
+ AS_PROBLEM_KIND_STYLE_INCORRECT,
+ "<p> was empty");
+ return;
+ }
+
/* relax the requirements a bit */
if ((helper->flags & AS_APP_VALIDATE_FLAG_RELAX) > 0) {
length_para_max = 1000;