dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
b1bcb2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b1bcb2
From: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Date: Tue, 24 Nov 2020 18:04:22 +0000
b1bcb2
Subject: [PATCH] gnulib/regcomp: Fix uninitialized re_token
b1bcb2
b1bcb2
This issue has been fixed in the latest version of gnulib, so to
b1bcb2
maintain consistency, I've backported that change rather than doing
b1bcb2
something different.
b1bcb2
b1bcb2
Fixes: CID 73828
b1bcb2
b1bcb2
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
b1bcb2
---
b1bcb2
 grub-core/gnulib/regcomp.c                      |  3 +--
b1bcb2
 conf/Makefile.extra-dist                        |  1 +
b1bcb2
 grub-core/gnulib-fix-regcomp-uninit-token.patch | 12 ++++++++++++
b1bcb2
 3 files changed, 14 insertions(+), 2 deletions(-)
b1bcb2
 create mode 100644 grub-core/gnulib-fix-regcomp-uninit-token.patch
b1bcb2
b1bcb2
diff --git a/grub-core/gnulib/regcomp.c b/grub-core/gnulib/regcomp.c
b1bcb2
index de9f622088f..6d0830ac691 100644
b1bcb2
--- a/grub-core/gnulib/regcomp.c
b1bcb2
+++ b/grub-core/gnulib/regcomp.c
b1bcb2
@@ -3790,8 +3790,7 @@ static bin_tree_t *
b1bcb2
 create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
b1bcb2
 	     re_token_type_t type)
b1bcb2
 {
b1bcb2
-  re_token_t t;
b1bcb2
-  t.type = type;
b1bcb2
+  re_token_t t = { .type = type };
b1bcb2
   return create_token_tree (dfa, left, right, &t);
b1bcb2
 }
b1bcb2
 
b1bcb2
diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
b1bcb2
index 60d9f564236..68e5d0eda7b 100644
b1bcb2
--- a/conf/Makefile.extra-dist
b1bcb2
+++ b/conf/Makefile.extra-dist
b1bcb2
@@ -28,6 +28,7 @@ EXTRA_DIST += grub-core/genemuinitheader.sh
b1bcb2
 
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-null-deref.diff
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-null-state-deref.patch
b1bcb2
+EXTRA_DIST += grub-core/gnulib-fix-regcomp-uninit-token.patch
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-regexec-null-deref.patch
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-uninit-structure.patch
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-unused-value.patch
b1bcb2
diff --git a/grub-core/gnulib-fix-regcomp-uninit-token.patch b/grub-core/gnulib-fix-regcomp-uninit-token.patch
b1bcb2
new file mode 100644
b1bcb2
index 00000000000..d615745221b
b1bcb2
--- /dev/null
b1bcb2
+++ b/grub-core/gnulib-fix-regcomp-uninit-token.patch
b1bcb2
@@ -0,0 +1,12 @@
b1bcb2
+--- grub-core/gnulib/regcomp.c
b1bcb2
++++ grub-core/gnulib/regcomp.c
b1bcb2
+@@ -3808,8 +3808,7 @@ static bin_tree_t *
b1bcb2
+ create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
b1bcb2
+ 	     re_token_type_t type)
b1bcb2
+ {
b1bcb2
+-  re_token_t t;
b1bcb2
+-  t.type = type;
b1bcb2
++  re_token_t t = { .type = type };
b1bcb2
+   return create_token_tree (dfa, left, right, &t);
b1bcb2
+ }
b1bcb2
+