]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsmsg: add extra NULL check, to htsmsg_cmp()
authorJaroslav Kysela <perex@perex.cz>
Thu, 12 Nov 2015 08:22:43 +0000 (09:22 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 12 Nov 2015 08:23:30 +0000 (09:23 +0100)
src/htsmsg.c

index ca59df8d3d4d8d3ec00fb36be700d547c99df77d..a31e06ae3c5336b297561b367e663e966b250530 100644 (file)
@@ -951,6 +951,12 @@ htsmsg_cmp(htsmsg_t *m1, htsmsg_t *m2)
     return 1;
 
   f2 = TAILQ_FIRST(&m2->hm_fields);
+  if (f2 == NULL) {
+    if (TAILQ_FIRST(&m1->hm_fields) == NULL)
+      return 0;
+    return 1;
+  }
+
   TAILQ_FOREACH(f1, &m1->hm_fields, hmf_link) {
 
     if (f1->hmf_type != f2->hmf_type)