~ubuntu-branches/ubuntu/lucid/seamonkey/lucid-security

« back to all changes in this revision

Viewing changes to security/nss/lib/freebl/loader.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-07-29 21:29:02 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080729212902-spm9kpvchp9udwbw
Tags: 1.1.11+nobinonly-0ubuntu1
* New security upstream release: 1.1.11 (LP: #218534)
  Fixes USN-602-1, USN-619-1, USN-623-1 and USN-629-1
* Refresh diverged patch:
  - update debian/patches/80_security_build.patch
* Fix FTBFS with missing -lfontconfig
  - add debian/patches/11_fix_ftbfs_with_fontconfig.patch
  - update debian/patches/series
* Build with default gcc (hardy: 4.2, intrepid: 4.3)
  - update debian/rules
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * the terms of any one of the MPL, the GPL or the LGPL.
38
38
 *
39
39
 * ***** END LICENSE BLOCK ***** */
40
 
/* $Id: loader.c,v 1.26.2.4 2006/10/02 21:17:58 julien.pierre.bugs%sun.com Exp $ */
 
40
/* $Id: loader.c,v 1.26.2.7 2008/01/22 04:09:04 nelson%bolyard.com Exp $ */
41
41
 
42
42
#include "loader.h"
43
43
#include "prmem.h"
44
44
#include "prerror.h"
45
45
#include "prinit.h"
 
46
#include "prenv.h"
46
47
 
47
48
static const char* default_name =
48
49
    SHLIB_PREFIX"freebl"SHLIB_VERSION"."SHLIB_SUFFIX;
86
87
    buflen = sysinfo(SI_ISALIST, buf, sizeof buf);
87
88
    if (buflen <= 0) 
88
89
        return NULL;
 
90
    /* sysinfo output is always supposed to be NUL terminated, but ... */
 
91
    if (buflen < sizeof buf) 
 
92
        buf[buflen] = '\0';
 
93
    else
 
94
        buf[(sizeof buf) - 1] = '\0';
89
95
    /* The ISA list is a space separated string of names of ISAs and
90
96
     * ISA extensions, in order of decreasing performance.
91
97
     * There are two different ISAs with which NSS's crypto code can be
987
993
   * only called from functions that are also defined as not thread-safe,
988
994
   * namely C_Finalize in softoken, and the SSL bypass shutdown callback called
989
995
   * from NSS_Shutdown. */
 
996
  char *disableUnload = NULL;
990
997
  vector = NULL;
991
998
  /* If an SSL socket is configured with SSL_BYPASS_PKCS11, but the application
992
999
   * never does a handshake on it, BL_Unload will be called even though freebl
993
1000
   * was never loaded. So, don't assert blLib. */
994
1001
  if (blLib) {
995
 
      PRStatus status = PR_UnloadLibrary(blLib);
996
 
      PORT_Assert(PR_SUCCESS == status);
 
1002
      disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
 
1003
      if (!disableUnload) {
 
1004
          PRStatus status = PR_UnloadLibrary(blLib);
 
1005
          PORT_Assert(PR_SUCCESS == status);
 
1006
      }
997
1007
      blLib = NULL;
998
1008
  }
999
1009
  loadFreeBLOnce = pristineCallOnce;