File: CVE-2021-43579.patch

package info (click to toggle)
htmldoc 1.9.3-1%2Bdeb10u4
  • links: PTS
  • area: main
  • in suites: buster
  • size: 15,224 kB
  • sloc: ansic: 67,846; cpp: 24,380; makefile: 352; sh: 149; java: 59; php: 36; xml: 10; perl: 7
file content (27 lines) | stat: -rw-r--r-- 781 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
22
23
24
25
26
27
commit 27d08989a5a567155d506ac870ae7d8cc88fa58b
Author: Michael R Sweet <msweet@msweet.org>
Date:   Fri Nov 5 09:35:10 2021 -0400

    Fix potential BMP stack overflow (Issue #453)

Index: htmldoc-1.9.3/htmldoc/image.cxx
===================================================================
--- htmldoc-1.9.3.orig/htmldoc/image.cxx	2022-02-26 01:02:38.045520508 +0100
+++ htmldoc-1.9.3/htmldoc/image.cxx	2022-02-26 01:02:38.045520508 +0100
@@ -904,12 +904,16 @@
     return (-1);
 
   if (info_size > 40)
+  {
     for (info_size -= 40; info_size > 0; info_size --)
       getc(fp);
+  }
 
   // Get colormap...
   if (colors_used == 0 && depth <= 8)
     colors_used = 1 << depth;
+  else if (colors_used > 256)
+    return (-1);
 
   fread(colormap, (size_t)colors_used, 4, fp);