diff options
Diffstat (limited to 'meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch')
-rw-r--r-- | meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch b/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch new file mode 100644 index 0000000000..102a494561 --- /dev/null +++ b/meta/recipes-bsp/grub/files/0010-gnulib-argp-help-Fix-dereference-of-a-possibly-NULL-.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From eaf9da8b5f8349c51cfc89dd8e39a1a61f89790a Mon Sep 17 00:00:00 2001 | ||
2 | From: Darren Kenny <darren.kenny@oracle.com> | ||
3 | Date: Wed, 28 Oct 2020 14:43:01 +0000 | ||
4 | Subject: [PATCH] gnulib/argp-help: Fix dereference of a possibly NULL state | ||
5 | |||
6 | All other instances of call to __argp_failure() where there is | ||
7 | a dgettext() call is first checking whether state is NULL before | ||
8 | attempting to dereference it to get the root_argp->argp_domain. | ||
9 | |||
10 | Fixes: CID 292436 | ||
11 | |||
12 | Signed-off-by: Darren Kenny <darren.kenny@oracle.com> | ||
13 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
14 | |||
15 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3a37bf120a9194c373257c70175cdb5b337bc107] | ||
16 | Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> | ||
17 | --- | ||
18 | conf/Makefile.extra-dist | 1 + | ||
19 | .../lib/gnulib-patches/fix-null-state-deref.patch | 12 ++++++++++++ | ||
20 | 2 files changed, 13 insertions(+) | ||
21 | create mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch | ||
22 | |||
23 | diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist | ||
24 | index 9e55458..96d7e69 100644 | ||
25 | --- a/conf/Makefile.extra-dist | ||
26 | +++ b/conf/Makefile.extra-dist | ||
27 | @@ -29,6 +29,7 @@ EXTRA_DIST += grub-core/genemuinit.sh | ||
28 | EXTRA_DIST += grub-core/genemuinitheader.sh | ||
29 | |||
30 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch | ||
31 | +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch | ||
32 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch | ||
33 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch | ||
34 | EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch | ||
35 | diff --git a/grub-core/lib/gnulib-patches/fix-null-state-deref.patch b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch | ||
36 | new file mode 100644 | ||
37 | index 0000000..813ec09 | ||
38 | --- /dev/null | ||
39 | +++ b/grub-core/lib/gnulib-patches/fix-null-state-deref.patch | ||
40 | @@ -0,0 +1,12 @@ | ||
41 | +--- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000 | ||
42 | ++++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000 | ||
43 | +@@ -145,7 +145,8 @@ | ||
44 | + if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) | ||
45 | + { | ||
46 | + __argp_failure (state, 0, 0, | ||
47 | +- dgettext (state->root_argp->argp_domain, | ||
48 | ++ dgettext (state == NULL ? NULL | ||
49 | ++ : state->root_argp->argp_domain, | ||
50 | + "\ | ||
51 | + ARGP_HELP_FMT: %s value is less than or equal to %s"), | ||
52 | + "rmargin", up->name); | ||