File: 04-fix-a-heap-buffer-underread-in-set-buf-break.patch

package info (click to toggle)
indent 2.2.13-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,696 kB
  • sloc: ansic: 20,903; sh: 5,035; makefile: 165; sed: 16; cpp: 5
file content (16 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (4)
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 */
     }