]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
freesat bouquet parser: fix endless loop (double list insert), fixes #4851
authorJaroslav Kysela <perex@perex.cz>
Wed, 6 Mar 2019 19:01:26 +0000 (20:01 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 6 Mar 2019 19:05:29 +0000 (20:05 +0100)
src/input/mpegts/dvb_psi.c

index aa15ae946c9eaed3074f8c311ce279bc01659134..257d5f1dbf4acaee9c198c1b438daa1bfb8e799a 100644 (file)
@@ -717,13 +717,17 @@ dvb_freesat_completed
             bs->fallback = fs;
           continue;
         }
+        /* already assigned? skip it */
+        if (TAILQ_SAFE_ENTRY(fs, region_link))
+          continue;
         LIST_FOREACH(fr, &bi->fregions, link)
           if (fr->regionid == fs->regionid)
             break;
-        if (!fr)
+        if (!fr) {
           tvhtrace(mt->mt_subsys, "%s: cannot find freesat region id %u", mt->mt_name, fs->regionid);
-        else
-          TAILQ_INSERT_TAIL(&fr->services, fs, region_link);
+          continue;
+        }
+        TAILQ_INSERT_TAIL(&fr->services, fs, region_link);
       }
   }