File: 0008-check-number-of-repeat_count.patch

package info (click to toggle)
libsixel 1.8.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,632 kB
  • sloc: ansic: 23,497; sh: 8,443; cpp: 1,227; python: 526; makefile: 444; xml: 271; ruby: 31; perl: 26
file content (24 lines) | stat: -rw-r--r-- 773 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: NOKUBI Takatsugu <knok@daionet.gr.jp>
Date: Fri, 30 Aug 2019 11:37:02 +0900
Subject: check number of repeat_count

---
 src/fromsixel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/fromsixel.c b/src/fromsixel.c
index f451c80..bc7dfbe 100644
--- a/src/fromsixel.c
+++ b/src/fromsixel.c
@@ -733,6 +733,11 @@ sixel_decode_raw_impl(
                 if (context->repeat_count == 0) {
                     context->repeat_count = 1;
                 }
+                if (context->repeat_count > 0x7fff) { /* check too huge number
+*/
+                    status = SIXEL_BAD_INPUT;
+                    goto end;
+                }
                 context->state = PS_DECSIXEL;
                 context->param = 0;
                 context->nparams = 0;