This is the mail archive of the
mailing list for the glibc project.
[Bug dynamic-link/22238] NULL pointer dereference in dlopen on out-of-memory
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 05 Oct 2017 10:28:46 +0000
- Subject: [Bug dynamic-link/22238] NULL pointer dereference in dlopen on out-of-memory
- Auto-submitted: auto-generated
- References: <firstname.lastname@example.org/bugzilla/>
--- Comment #13 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Carlos O'Donell from comment #11)
> I had to fix one more thing though:
> diff --git a/elf/dl-error-skeleton.c b/elf/dl-error-skeleton.c
> index 5b0fc89..6543e39 100644
> --- a/elf/dl-error-skeleton.c
> +++ b/elf/dl-error-skeleton.c
> @@ -75,6 +75,8 @@ fatal_error (int errcode, const char *objname, const char
> const char *errstring)
> char buffer;
> + if (objname == NULL)
> + objname = "NULL";
> _dl_fatal_printf ("%s: %s: %s%s%s%s%s\n",
> occasion ?: N_("error while loading shared libraries"),
> Otherwise we crash in fatal_error attempting to deref objname.
> Florian, what do you think we should do here? It's common practice to elide
> objname in some of these calls and use NULL.
> In the old code after refactoring we had:
> 9e78f6f6 (Florian Weimer 2016-11-30 15:59:57 +0100 89) if (objname ==
> 9e78f6f6 (Florian Weimer 2016-11-30 15:59:57 +0100 90) objname = "";
> Which we dropped in a later cleanup.
> We should probably put back the these two lines in fatal_error.
Right, but this is a separate fix (and please use "", not "NULL").
You are receiving this mail because:
You are on the CC list for the bug.