]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
capmt: add protection for out-of-valid-data access, fixes #4430
authorJaroslav Kysela <perex@perex.cz>
Wed, 14 Jun 2017 06:03:21 +0000 (08:03 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 14 Jun 2017 06:03:56 +0000 (08:03 +0200)
src/descrambler/capmt.c

index 4e89fd8a8a3154910a064320bbac3e7be6311383..ec9a530f305222b56597101d5427d131dabbf79f 100644 (file)
@@ -1559,6 +1559,8 @@ handle_single(capmt_t *capmt)
         offset = 0;
         cmd_size = 0;
         cmd = 0;
+        if (buffer.sb_ptr < 5)
+          break;
         if (netproto) {
           buffer.sb_bswap = 1;
           cmd_size = capmt_msg_size(capmt, &buffer, 0);