Package: indent / 2.2.12-4+deb12u3

05-fix-a-heap-buffer-underread-in-set-buf-break.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
From: Petr Písař <ppisar@redhat.com>
Subject: Fix a heap buffer underread in set_buf_break()
Bug-Debian: https://bugs.debian.org/1061543
Forwarded: https://lists.gnu.org/archive/html/bug-indent/2024-01/msg00001.html

--- a/src/output.c
+++ b/src/output.c
@@ -290,7 +290,7 @@
     /* Did we just parse a bracket that will be put on the next line
      * by this line break? */
 
-    if ((*token == '(') || (*token == '['))
+    if (level > 0 && ((*token == '(') || (*token == '[')))
     {
         --level;                        /* then don't take it into account */
     }