indent/indent-CVE-2024-0911.patch
Danilo Spinella da3535092f Accepting request 1147061 from home:pgajdos
- security update
- added patches
  fix CVE-2024-0911 [bsc#1219210], heap-based buffer overflow in set_buf_break()
  + indent-CVE-2024-0911.patch

OBS-URL: https://build.opensuse.org/request/show/1147061
OBS-URL: https://build.opensuse.org/package/show/devel:tools/indent?expand=0&rev=22
2024-02-19 09:08:44 +00:00

17 lines
463 B
Diff

diff --git a/src/output.c b/src/output.c
index ee01bcc..17eee6e 100644
--- a/src/output.c
+++ b/src/output.c
@@ -290,7 +290,7 @@ void set_buf_break (
/* 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 */
}
--
2.43.0