grub2/grub-core/lib/gnulib-patches/fix-null-state-deref.patch
Darren Kenny 3a37bf120a gnulib/argp-help: Fix dereference of a possibly NULL state
All other instances of call to __argp_failure() where there is
a dgettext() call is first checking whether state is NULL before
attempting to dereference it to get the root_argp->argp_domain.

Fixes: CID 292436

Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-02 15:54:16 +01:00

13 lines
601 B
Diff

--- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000
+++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000
@@ -145,7 +145,8 @@
if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin)
{
__argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
+ dgettext (state == NULL ? NULL
+ : state->root_argp->argp_domain,
"\
ARGP_HELP_FMT: %s value is less than or equal to %s"),
"rmargin", up->name);