File: 0004-position-error-check.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 (23 lines) | stat: -rw-r--r-- 701 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
From: Takatsugu Nokubi <takatsugu.nokubi@robotfund.co.jp>
Date: Thu, 25 Jul 2019 16:19:59 +0900
Subject: position error check

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

diff --git a/src/fromsixel.c b/src/fromsixel.c
index 7d8390a..1d86858 100644
--- a/src/fromsixel.c
+++ b/src/fromsixel.c
@@ -572,6 +572,10 @@ sixel_decode_raw_impl(
                         image->ncolors = context->color_index;
                     }
 
+                    if (context->pos_x < 0 || context->pos_y < 0) {
+                        status = SIXEL_BAD_INPUT;
+                        goto end;
+                    }
                     bits = *p - '?';
 
                     if (bits == 0) {