summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-03-07 13:39:47 +0100
committerZheng Junjie <z572@z572.online>2025-06-23 12:32:51 +0800
commit57397fd03fdea734814d999e00a2a194d74498c5 (patch)
tree85f07edc386637f72e02ca3c43f369eaf13b9a5b /gnu
parent7d1f5f950f94d06548b4693dc00b8c47d66a3edf (diff)
gnu: indent: Update to 2.2.13-0.1737c92.
* gnu/packages/patches/indent-CVE-2024-0911.patch: Delete file. * gnu/local.mk: Unregister patch. * gnu/packages/code.scm (indent): Update to 2.2.13-0.1737c92. [arguments]{phases}: Add phase 'patch-bootstrap. [native-inputs]: Add autoconf-2.71, automake, gettext-minimal. [properties]: Add lint-hidden-cves. Signed-off-by: Zheng Junjie <z572@z572.online>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/code.scm62
-rw-r--r--gnu/packages/patches/indent-CVE-2024-0911.patch61
3 files changed, 43 insertions, 81 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 8ec28bc03a4..dcea2c33556 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1622,7 +1622,6 @@ dist_patch_DATA = \
1622 %D%/packages/patches/id3lib-UTF16-writing-bug.patch \ 1622 %D%/packages/patches/id3lib-UTF16-writing-bug.patch \
1623 %D%/packages/patches/idris-test-ffi008.patch \ 1623 %D%/packages/patches/idris-test-ffi008.patch \
1624 %D%/packages/patches/ilmbase-fix-tests.patch \ 1624 %D%/packages/patches/ilmbase-fix-tests.patch \
1625 %D%/packages/patches/indent-CVE-2024-0911.patch \
1626 %D%/packages/patches/inferno-fix-crash.patch \ 1625 %D%/packages/patches/inferno-fix-crash.patch \
1627 %D%/packages/patches/instead-use-games-path.patch \ 1626 %D%/packages/patches/instead-use-games-path.patch \
1628 %D%/packages/patches/intltool-perl-compatibility.patch \ 1627 %D%/packages/patches/intltool-perl-compatibility.patch \
diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index 9d048933d3f..c4c423c8466 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -22,6 +22,7 @@
22;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com> 22;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
23;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com> 23;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
24;;; Copyright © 2024 Jordan Moore <lockbox@struct.foo> 24;;; Copyright © 2024 Jordan Moore <lockbox@struct.foo>
25;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr>
25;;; 26;;;
26;;; This file is part of GNU Guix. 27;;; This file is part of GNU Guix.
27;;; 28;;;
@@ -64,6 +65,7 @@
64 #:use-module (gnu packages emacs) 65 #:use-module (gnu packages emacs)
65 #:use-module (gnu packages flex) 66 #:use-module (gnu packages flex)
66 #:use-module (gnu packages gcc) 67 #:use-module (gnu packages gcc)
68 #:use-module (gnu packages gettext)
67 #:use-module (gnu packages golang-build) 69 #:use-module (gnu packages golang-build)
68 #:use-module (gnu packages golang-crypto) 70 #:use-module (gnu packages golang-crypto)
69 #:use-module (gnu packages golang-web) 71 #:use-module (gnu packages golang-web)
@@ -875,29 +877,51 @@ the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
875 (license license:lgpl3+))) 877 (license license:lgpl3+)))
876 878
877(define-public indent 879(define-public indent
878 (package 880 ;; XXX: Not released anymore, but some patches fix CVEs.
879 (name "indent") 881 (let ((commit "1737c929cbe2ec8a181107df9742894a44c57f71")
880 (version "2.2.13") 882 (revision "0"))
881 (source (origin 883 (package
882 (method url-fetch) 884 (name "indent")
883 (uri (string-append "mirror://gnu/indent/indent-" version 885 (version (git-version "2.2.13" revision commit))
884 ".tar.gz")) 886 (source
885 (sha256 887 (origin
886 (base32 "15c0ayp9rib7hzvrcxm5ijs0mpagw5y8kf5w0jr9fryfqi7n6r4y")) 888 (method git-fetch)
887 ;; Remove patch when updating. 889 (uri (git-reference
888 (patches (search-patches "indent-CVE-2024-0911.patch")))) 890 (url "https://git.savannah.gnu.org/git/indent")
889 (build-system gnu-build-system) 891 (commit commit)))
890 (native-inputs 892 (file-name (git-file-name name version))
891 (list texinfo)) 893 (sha256
892 (synopsis "Code reformatter") 894 (base32 "138bqlwvfjv3w1plw2zzf0nqw38lhgimzx1gic6p8r5kizjp9123"))))
893 (description 895 (build-system gnu-build-system)
894 "Indent is a program that makes source code easier to read by 896 (arguments
897 (list #:phases
898 #~(modify-phases %standard-phases
899 (add-after 'unpack 'patch-bootstrap
900 (lambda _
901 (substitute* "bootstrap"
902 (("^(wget|\\./configure|rm)" all)
903 (string-append "#" all)))
904 (call-with-output-file "doc/version.texi"
905 (lambda (port)
906 (format port "\
907@set UPDATED
908@set EDITION ~a
909@set VERSION ~a"
910 #$version
911 #$version))))))))
912 (native-inputs
913 (list autoconf-2.71 automake gettext-minimal texinfo))
914 (home-page "https://www.gnu.org/software/indent/")
915 (synopsis "Code reformatter")
916 (description
917 "Indent is a program that makes source code easier to read by
895reformatting it in a consistent style. It can change the style to one of 918reformatting it in a consistent style. It can change the style to one of
896several different styles such as GNU, BSD or K&R. It has some flexibility to 919several different styles such as GNU, BSD or K&R. It has some flexibility to
897deal with incomplete or malformed syntax. GNU indent offers several 920deal with incomplete or malformed syntax. GNU indent offers several
898extensions over the standard utility.") 921extensions over the standard utility.")
899 (license license:gpl3+) 922 (license license:gpl3+)
900 (home-page "https://www.gnu.org/software/indent/"))) 923 (properties '((lint-hidden-cves . ("CVE-2023-40305"
924 "CVE-2024-0911")))))))
901 925
902(define-public amalgamate 926(define-public amalgamate
903 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208") 927 (let* ((commit "c91f07eea1133aa184f652b8f1398eaf03586208")
diff --git a/gnu/packages/patches/indent-CVE-2024-0911.patch b/gnu/packages/patches/indent-CVE-2024-0911.patch
deleted file mode 100644
index 4687d3f59ae..00000000000
--- a/gnu/packages/patches/indent-CVE-2024-0911.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1Upstream issue: https://lists.gnu.org/archive/html/bug-indent/2024-01/msg00001.html
2Signed-off-by: Petr Písař <ppisar@redhat.com>
3---
4 regression/TEST | 2 +-
5 regression/input/comment-parent-heap-underread.c | 3 +++
6 regression/standard/comment-parent-heap-underread.c | 5 +++++
7 src/output.c | 2 +-
8 4 files changed, 10 insertions(+), 2 deletions(-)
9 create mode 100644 regression/input/comment-parent-heap-underread.c
10 create mode 100644 regression/standard/comment-parent-heap-underread.c
11
12diff --git a/regression/TEST b/regression/TEST
13index 7c07c2e..951b1a2 100755
14--- a/regression/TEST
15+++ b/regression/TEST
16@@ -40,6 +40,7 @@ BUGS="case-label.c one-line-1.c one-line-2.c one-line-3.c \
17 macro.c enum.c elif.c nested.c wrapped-string.c minus_predecrement.c \
18 bug-gnu-33364.c float-constant-suffix.c block-comments.c \
19- no-forced-nl-in-block-init.c hexadecimal_float.c binary-constant.c"
20+ no-forced-nl-in-block-init.c hexadecimal_float.c binary-constant.c \
21+ comment-parent-heap-underread.c"
22
23 INDENTSRC="args.c backup.h backup.c dirent_def.h globs.c indent.h \
24 indent.c indent_globs.h io.c lexi.c memcpy.c parse.c pr_comment.c \
25diff --git a/regression/input/comment-parent-heap-underread.c
26b/regression/input/comment-parent-heap-underread.c
27new file mode 100644
28index 0000000..68e13cf
29--- /dev/null
30+++ b/regression/input/comment-parent-heap-underread.c
31@@ -0,0 +1,3 @@
32+void foo(void) {
33+/*a*/(1);
34+}
35diff --git a/regression/standard/comment-parent-heap-underread.c
36b/regression/standard/comment-parent-heap-underread.c
37new file mode 100644
38index 0000000..9a1c6e3
39--- /dev/null
40+++ b/regression/standard/comment-parent-heap-underread.c
41@@ -0,0 +1,5 @@
42+void
43+foo (void)
44+{
45+/*a*/ (1);
46+}
47diff --git a/src/output.c b/src/output.c
48index ee01bcc..17eee6e 100644
49--- a/src/output.c
50+++ b/src/output.c
51@@ -290,7 +290,7 @@ void set_buf_break (
52 /* Did we just parse a bracket that will be put on the next line
53 * by this line break? */
54
55- if ((*token == '(') || (*token == '['))
56+ if (level > 0 && ((*token == '(') || (*token == '[')))
57 {
58 --level; /* then don't take it into account */
59 }
60--
612.43.0