0059-gnulib-regcomp-Fix-uninitialized-re_token.patch 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From 03477085f9a33789ba6cca7cd49ab9326a1baa0e Mon Sep 17 00:00:00 2001
  2. From: Darren Kenny <darren.kenny@oracle.com>
  3. Date: Tue, 24 Nov 2020 18:04:22 +0000
  4. Subject: [PATCH] gnulib/regcomp: Fix uninitialized re_token
  5. This issue has been fixed in the latest version of gnulib, so to
  6. maintain consistency, I've backported that change rather than doing
  7. something different.
  8. Fixes: CID 73828
  9. Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
  10. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  11. [Add changes to generated files]
  12. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  13. ---
  14. Makefile.in | 1 +
  15. conf/Makefile.extra-dist | 1 +
  16. .../lib/gnulib-patches/fix-regcomp-uninit-token.patch | 15 +++++++++++++++
  17. grub-core/lib/gnulib/regcomp.c | 6 +-----
  18. 4 files changed, 18 insertions(+), 5 deletions(-)
  19. create mode 100644 grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch
  20. diff --git a/Makefile.in b/Makefile.in
  21. index d9da6e9..9442504 100644
  22. --- a/Makefile.in
  23. +++ b/Makefile.in
  24. @@ -2743,6 +2743,7 @@ EXTRA_DIST = autogen.sh geninit.sh gentpl.py Makefile.util.def \
  25. grub-core/genemuinit.sh grub-core/genemuinitheader.sh \
  26. grub-core/lib/gnulib-patches/fix-null-deref.patch \
  27. grub-core/lib/gnulib-patches/fix-null-state-deref.patch \
  28. + grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch \
  29. grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch \
  30. grub-core/lib/gnulib-patches/fix-uninit-structure.patch \
  31. grub-core/lib/gnulib-patches/fix-unused-value.patch \
  32. diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
  33. index d27d3a9..ffe6829 100644
  34. --- a/conf/Makefile.extra-dist
  35. +++ b/conf/Makefile.extra-dist
  36. @@ -30,6 +30,7 @@ EXTRA_DIST += grub-core/genemuinitheader.sh
  37. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch
  38. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch
  39. +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch
  40. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch
  41. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch
  42. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
  43. diff --git a/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch b/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch
  44. new file mode 100644
  45. index 0000000..02e0631
  46. --- /dev/null
  47. +++ b/grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch
  48. @@ -0,0 +1,15 @@
  49. +--- a/lib/regcomp.c 2020-11-24 17:06:08.159223858 +0000
  50. ++++ b/lib/regcomp.c 2020-11-24 17:06:15.630253923 +0000
  51. +@@ -3808,11 +3808,7 @@
  52. + create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
  53. + re_token_type_t type)
  54. + {
  55. +- re_token_t t;
  56. +-#if defined GCC_LINT || defined lint
  57. +- memset (&t, 0, sizeof t);
  58. +-#endif
  59. +- t.type = type;
  60. ++ re_token_t t = { .type = type };
  61. + return create_token_tree (dfa, left, right, &t);
  62. + }
  63. +
  64. diff --git a/grub-core/lib/gnulib/regcomp.c b/grub-core/lib/gnulib/regcomp.c
  65. index 2545d3e..64a4fa7 100644
  66. --- a/grub-core/lib/gnulib/regcomp.c
  67. +++ b/grub-core/lib/gnulib/regcomp.c
  68. @@ -3808,11 +3808,7 @@ static bin_tree_t *
  69. create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
  70. re_token_type_t type)
  71. {
  72. - re_token_t t;
  73. -#if defined GCC_LINT || defined lint
  74. - memset (&t, 0, sizeof t);
  75. -#endif
  76. - t.type = type;
  77. + re_token_t t = { .type = type };
  78. return create_token_tree (dfa, left, right, &t);
  79. }
  80. --
  81. 2.14.2