Lines Matching +full:2020 +full:- +full:12 +full:- +full:10
3 Date: Thu, 5 Nov 2020 10:57:14 +0000
4 Subject: [PATCH] gnulib/regexec: Fix possible null-dereference
6 It appears to be possible that the mctx->state_log field may be NULL,
13 Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
14 Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
16 Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
17 ---
19 conf/Makefile.extra-dist | 1 +
20 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch | 12 ++++++++++++
21 grub-core/lib/gnulib/regexec.c | 3 +++
23 create mode 100644 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch
25 diff --git a/Makefile.in b/Makefile.in
27 --- a/Makefile.in
29 @@ -2743,6 +2743,7 @@ EXTRA_DIST = autogen.sh geninit.sh gentpl.py Makefile.util.def \
30 grub-core/genemuinit.sh grub-core/genemuinitheader.sh \
31 grub-core/lib/gnulib-patches/fix-null-deref.patch \
32 grub-core/lib/gnulib-patches/fix-null-state-deref.patch \
33 + grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch \
34 grub-core/lib/gnulib-patches/fix-uninit-structure.patch \
35 grub-core/lib/gnulib-patches/fix-unused-value.patch \
36 grub-core/lib/gnulib-patches/fix-width.patch \
37 diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
39 --- a/conf/Makefile.extra-dist
40 +++ b/conf/Makefile.extra-dist
41 @@ -30,6 +30,7 @@ EXTRA_DIST += grub-core/genemuinitheader.sh
43 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch
44 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch
45 +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch
46 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch
47 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
48 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
49 diff --git a/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch b/grub-core/lib/gnulib-patch…
52 --- /dev/null
53 +++ b/grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch
54 @@ -0,0 +1,12 @@
55 +--- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000
56 ++++ b/lib/regexec.c 2020-11-05 10:55:09.621542984 +0000
57 +@@ -1692,6 +1692,9 @@
59 + Idx top = mctx->state_log_top;
61 ++ if (mctx->state_log == NULL)
64 + if ((next_state_log_idx >= mctx->input.bufs_len
65 + && mctx->input.bufs_len < mctx->input.len)
66 + || (next_state_log_idx >= mctx->input.valid_len
67 diff --git a/grub-core/lib/gnulib/regexec.c b/grub-core/lib/gnulib/regexec.c
69 --- a/grub-core/lib/gnulib/regexec.c
70 +++ b/grub-core/lib/gnulib/regexec.c
71 @@ -1696,6 +1696,9 @@ clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
73 Idx top = mctx->state_log_top;
75 + if (mctx->state_log == NULL)
78 if ((next_state_log_idx >= mctx->input.bufs_len
79 && mctx->input.bufs_len < mctx->input.len)
80 || (next_state_log_idx >= mctx->input.valid_len
81 --