File: 0004-malloc-size-check.patch

package info (click to toggle)
libsixel 1.5.2-2%2Bdeb9u1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 13,684 kB
  • sloc: ansic: 20,253; sh: 4,273; cpp: 1,227; makefile: 402; python: 306; xml: 271; ruby: 31; perl: 26
file content (21 lines) | stat: -rw-r--r-- 698 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: NOKUBI Takatsugu <knok@daionet.gr.jp>
Date: Thu, 22 Aug 2019 15:30:36 +0900
Subject: malloc size check

---
 src/fromsixel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fromsixel.c b/src/fromsixel.c
index a60b4bc..648095a 100644
--- a/src/fromsixel.c
+++ b/src/fromsixel.c
@@ -475,7 +475,7 @@ sixel_decode_raw(
                 dmsx = nx;
                 dmsy = ny;
                 dmbuf = (unsigned char *)sixel_allocator_malloc(allocator, dmsx * dmsy);
-                if (dmbuf == NULL) {
+                if (dmbuf == NULL || dmsx * dmsy == 0) {
                     sixel_allocator_free(allocator, imbuf);
                     goto end;
                 }