This is the mail archive of the
cygwin-patches@sources.redhat.com
mailing list for the Cygwin project.
Re: 1.1.8: access violation in dlopen
- To: cygwin-patches at cygwin dot com
- Subject: Re: 1.1.8: access violation in dlopen
- From: Christopher Faylor <cgf at redhat dot com>
- Date: Wed, 14 Feb 2001 15:21:17 -0500
- References: <56.735ed4b.27bc0850@aol.com>
- Reply-To: cygwin-patches at cygwin dot com
Thanks for the patch. Please check out the Contributing link at
cygwin.com and provide an accompanying ChangeLog and I'll apply the
patch.
cgf
On Wed, Feb 14, 2001 at 11:12:00AM -0500, Chrisiasci@aol.com wrote:
>I add a problem where dlopen would access violate if passed a non-existent dll.
>
>The problem is that is this case, LoadLibrary is called with a NULL pointer.
>It also seems that this does not always AV (depending on Os version...).
>
>What this patch does is only checking the null pointer case and returning without trying to call LoadLibrary.
>
>
>
>--- dlfcn.cc.ori Tue Oct 10 02:00:50 2000
>+++ dlfcn.cc Wed Feb 14 14:54:40 2001
>@@ -177,7 +177,10 @@ dlopen (const char *name, int)
> {
> /* handle for the named library */
> const char *fullpath = get_full_path_of_dll (name);
>- ret = (void *) LoadLibrary (fullpath);
>+ if (fullpath)
>+ {
>+ ret = (void *) LoadLibrary (fullpath);
>+ }
> }
>
> if (!ret)
--
cgf@cygnus.com Red Hat, Inc.
http://sources.redhat.com/ http://www.redhat.com/