]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
bouquet: fix overflow when building for 32-bit system On 32-bit system hash value...
authorPeter Vicman <peter.vicman@gmail.com>
Tue, 24 Sep 2019 12:13:45 +0000 (14:13 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 6 Oct 2019 15:13:12 +0000 (17:13 +0200)
For example with #SERVICE 1:0:1:835:3EA:2174:EEEE0000:0:0:0
hash value EEEE0000 become 7FFFFFFF and there is no match in function mpegts_service_find_e2().

src/bouquet.c

index 8e0f1693807f3b16faae4c3fd9cbc0e4ef548138..35b3436ff02d4be4b1509625effe26a198986cbe 100644 (file)
@@ -1160,7 +1160,7 @@ parse_enigma2(bouquet_t *bq, char *data)
                                            uint32_t tsid, uint32_t onid,
                                            uint32_t hash);
   char *argv[11], *p, *tagname = NULL, *name;
-  long lv, stype, sid, tsid, onid, hash;
+  uint32_t lv, stype, sid, tsid, onid, hash;
   uint32_t seen = 0;
   int n, ver = 2;
 
@@ -1180,11 +1180,11 @@ service:
         if (strtol(argv[0], NULL, 0) != 1) goto next;  /* item type */
         lv = strtol(argv[1], NULL, 16);                /* service flags? */
         if (lv != 0 && lv != 0x64) goto next;
-        stype = strtol(argv[2], NULL, 16);             /* DVB service type */
-        sid   = strtol(argv[3], NULL, 16);             /* DVB service ID */
-        tsid  = strtol(argv[4], NULL, 16);
-        onid  = strtol(argv[5], NULL, 16);
-        hash  = strtol(argv[6], NULL, 16);
+        stype = strtoul(argv[2], NULL, 16);             /* DVB service type */
+        sid   = strtoul(argv[3], NULL, 16);             /* DVB service ID */
+        tsid  = strtoul(argv[4], NULL, 16);
+        onid  = strtoul(argv[5], NULL, 16);
+        hash  = strtoul(argv[6], NULL, 16);
         name  = n > 10 ? argv[10] : NULL;
         if (lv == 0) {
           service_t *s = mpegts_service_find_e2(stype, sid, tsid, onid, hash);