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

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