File: 0005-size-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 (21 lines) | stat: -rw-r--r-- 662 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
From: Takatsugu Nokubi <takatsugu.nokubi@robotfund.co.jp>
Date: Mon, 8 Jul 2019 12:20:58 +0900
Subject: size check

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

diff --git a/src/fromsixel.c b/src/fromsixel.c
index 1d86858..8cc8ce0 100644
--- a/src/fromsixel.c
+++ b/src/fromsixel.c
@@ -290,7 +290,7 @@ image_buffer_resize(
 
     size = (size_t)(width * height);
     alt_buffer = (unsigned char *)sixel_allocator_malloc(allocator, size);
-    if (alt_buffer == NULL) {
+    if (alt_buffer == NULL || size == 0) {
         /* free source image */
         sixel_allocator_free(allocator, image->data);
         image->data = NULL;