Blame SOURCES/0357-gnulib-regcomp-Fix-uninitialized-token-structure.patch

b1bcb2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b1bcb2
From: Darren Kenny <darren.kenny@oracle.com>
b1bcb2
Date: Thu, 22 Oct 2020 13:54:06 +0000
b1bcb2
Subject: [PATCH] gnulib/regcomp: Fix uninitialized token structure
b1bcb2
b1bcb2
The code is assuming that the value of br_token.constraint was
b1bcb2
initialized to zero when it wasn't.
b1bcb2
b1bcb2
While some compilers will ensure that, not all do, so it is better to
b1bcb2
fix this explicitly than leave it to chance.
b1bcb2
b1bcb2
Fixes: CID 73749
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                  |  2 +-
b1bcb2
 conf/Makefile.extra-dist                    |  1 +
b1bcb2
 grub-core/gnulib-fix-uninit-structure.patch | 11 +++++++++++
b1bcb2
 3 files changed, 13 insertions(+), 1 deletion(-)
b1bcb2
 create mode 100644 grub-core/gnulib-fix-uninit-structure.patch
b1bcb2
b1bcb2
diff --git a/grub-core/gnulib/regcomp.c b/grub-core/gnulib/regcomp.c
b1bcb2
index 596e0cf3ef7..de9f622088f 100644
b1bcb2
--- a/grub-core/gnulib/regcomp.c
b1bcb2
+++ b/grub-core/gnulib/regcomp.c
b1bcb2
@@ -3641,7 +3641,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
b1bcb2
   Idx alloc = 0;
b1bcb2
 #endif /* not RE_ENABLE_I18N */
b1bcb2
   reg_errcode_t ret;
b1bcb2
-  re_token_t br_token;
b1bcb2
+  re_token_t br_token = {0};
b1bcb2
   bin_tree_t *tree;
b1bcb2
 
b1bcb2
   sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
b1bcb2
diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
b1bcb2
index 7b305bce766..8baa6a831f7 100644
b1bcb2
--- a/conf/Makefile.extra-dist
b1bcb2
+++ b/conf/Makefile.extra-dist
b1bcb2
@@ -27,6 +27,7 @@ EXTRA_DIST += grub-core/genemuinit.sh
b1bcb2
 EXTRA_DIST += grub-core/genemuinitheader.sh
b1bcb2
 
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-null-deref.diff
b1bcb2
+EXTRA_DIST += grub-core/gnulib-fix-uninit-structure.patch
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-unused-value.patch
b1bcb2
 EXTRA_DIST += grub-core/gnulib-fix-width.diff
b1bcb2
 EXTRA_DIST += grub-core/gnulib-no-abort.diff
b1bcb2
diff --git a/grub-core/gnulib-fix-uninit-structure.patch b/grub-core/gnulib-fix-uninit-structure.patch
b1bcb2
new file mode 100644
b1bcb2
index 00000000000..7b4d9f67af4
b1bcb2
--- /dev/null
b1bcb2
+++ b/grub-core/gnulib-fix-uninit-structure.patch
b1bcb2
@@ -0,0 +1,11 @@
b1bcb2
+--- a/lib/regcomp.c	2020-10-22 13:49:06.770168928 +0000
b1bcb2
++++ b/lib/regcomp.c	2020-10-22 13:50:37.026528298 +0000
b1bcb2
+@@ -3662,7 +3662,7 @@
b1bcb2
+   Idx alloc = 0;
b1bcb2
+ #endif /* not RE_ENABLE_I18N */
b1bcb2
+   reg_errcode_t ret;
b1bcb2
+-  re_token_t br_token;
b1bcb2
++  re_token_t br_token = {0};
b1bcb2
+   bin_tree_t *tree;
b1bcb2
+ 
b1bcb2
+   sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);