0056-gnulib-regcomp-Fix-uninitialized-token-structure.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 75c3d3cec4f408848f575d6d5e30a95bd6313db0 Mon Sep 17 00:00:00 2001
  2. From: Darren Kenny <darren.kenny@oracle.com>
  3. Date: Thu, 22 Oct 2020 13:54:06 +0000
  4. Subject: [PATCH] gnulib/regcomp: Fix uninitialized token structure
  5. The code is assuming that the value of br_token.constraint was
  6. initialized to zero when it wasn't.
  7. While some compilers will ensure that, not all do, so it is better to
  8. fix this explicitly than leave it to chance.
  9. Fixes: CID 73749
  10. Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
  11. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  12. [Add changes to generated files]
  13. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  14. ---
  15. Makefile.in | 1 +
  16. conf/Makefile.extra-dist | 1 +
  17. grub-core/lib/gnulib-patches/fix-uninit-structure.patch | 11 +++++++++++
  18. grub-core/lib/gnulib/regcomp.c | 2 +-
  19. 4 files changed, 14 insertions(+), 1 deletion(-)
  20. create mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch
  21. diff --git a/Makefile.in b/Makefile.in
  22. index e6b287b..d58a7d7 100644
  23. --- a/Makefile.in
  24. +++ b/Makefile.in
  25. @@ -2742,6 +2742,7 @@ EXTRA_DIST = autogen.sh geninit.sh gentpl.py Makefile.util.def \
  26. grub-core/gensyminfo.sh.in grub-core/gensymlist.sh \
  27. grub-core/genemuinit.sh grub-core/genemuinitheader.sh \
  28. grub-core/lib/gnulib-patches/fix-null-deref.patch \
  29. + grub-core/lib/gnulib-patches/fix-uninit-structure.patch \
  30. grub-core/lib/gnulib-patches/fix-unused-value.patch \
  31. grub-core/lib/gnulib-patches/fix-width.patch \
  32. grub-core/lib/gnulib-patches/no-abort.patch \
  33. diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
  34. index 9b01152..9e55458 100644
  35. --- a/conf/Makefile.extra-dist
  36. +++ b/conf/Makefile.extra-dist
  37. @@ -29,6 +29,7 @@ EXTRA_DIST += grub-core/genemuinit.sh
  38. EXTRA_DIST += grub-core/genemuinitheader.sh
  39. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch
  40. +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch
  41. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
  42. EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
  43. EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch
  44. diff --git a/grub-core/lib/gnulib-patches/fix-uninit-structure.patch b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch
  45. new file mode 100644
  46. index 0000000..7b4d9f6
  47. --- /dev/null
  48. +++ b/grub-core/lib/gnulib-patches/fix-uninit-structure.patch
  49. @@ -0,0 +1,11 @@
  50. +--- a/lib/regcomp.c 2020-10-22 13:49:06.770168928 +0000
  51. ++++ b/lib/regcomp.c 2020-10-22 13:50:37.026528298 +0000
  52. +@@ -3662,7 +3662,7 @@
  53. + Idx alloc = 0;
  54. + #endif /* not RE_ENABLE_I18N */
  55. + reg_errcode_t ret;
  56. +- re_token_t br_token;
  57. ++ re_token_t br_token = {0};
  58. + bin_tree_t *tree;
  59. +
  60. + sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
  61. diff --git a/grub-core/lib/gnulib/regcomp.c b/grub-core/lib/gnulib/regcomp.c
  62. index fe7dfcb..2545d3e 100644
  63. --- a/grub-core/lib/gnulib/regcomp.c
  64. +++ b/grub-core/lib/gnulib/regcomp.c
  65. @@ -3662,7 +3662,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
  66. Idx alloc = 0;
  67. #endif /* not RE_ENABLE_I18N */
  68. reg_errcode_t ret;
  69. - re_token_t br_token;
  70. + re_token_t br_token = {0};
  71. bin_tree_t *tree;
  72. sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
  73. --
  74. 2.14.2