Bugzilla Bug 330364: fixed a NULL pointer dereference in NSPRPUB_PRE_4_2_CLIENT_BRANCH
authorwtchang%redhat.com
Mon, 13 Mar 2006 21:53:44 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 3612 cffaa580ebfba0b4f4627e15babcafe1278f1ed5
parent 3610 8f8d5f8ea4b2091e5c4a08a286baed40bc9b451c
child 3614 cdfce24e1926e7759fa97ddb085622c67e85abe3
push idunknown
push userunknown
push dateunknown
bugs330364
Bugzilla Bug 330364: fixed a NULL pointer dereference in PR_LoadStaticLibrary by moving the PR_LOG statement to the same location as in pr_LoadLibraryByPathname. The bug was discovered by Coverity's tool. r=Kenneth Herron,Gavin Sharp. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
pr/src/linking/prlink.c
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -1598,18 +1598,18 @@ PR_LoadStaticLibrary(const char *name, c
     lm->refCount    = 1;
     lm->dlh         = pr_exe_loadmap ? pr_exe_loadmap->dlh : 0;
     lm->staticTable = slt;
     lm->next        = pr_loadmap;
     pr_loadmap      = lm;
 
     result = lm;    /* success */
     PR_ASSERT(lm->refCount == 1);
+    PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Loaded library %s (static lib)", lm->name));
   unlock:
-    PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Loaded library %s (static lib)", lm->name));
     PR_ExitMonitor(pr_linker_lock);
     return result;
 }
 
 PR_IMPLEMENT(char *)
 PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
 {
 #if defined(USE_DLFCN) && (defined(SOLARIS) || defined(FREEBSD) \