Bugzilla Bug 330364: fixed a NULL pointer dereference in
authorwtchang%redhat.com
Mon, 13 Mar 2006 21:54:58 +0000
changeset 3613 a6e0f185f707cdd4908b7b9b6e27b66a25a62bb2
parent 3611 016151ef344b273a59152e74ef91e42bf0a846f4
child 3616 3b03fd1def2b2fa21b4ced8541d0e493a8faff29
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.
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) \