fixup commit for tag 'moz_ux_20021026' MOZILLA_1_2_BRANCH moz_ux_20021026
authorcvs2hg
Fri, 25 Oct 2002 23:16:22 +0000
branchMOZILLA_1_2_BRANCH
changeset 3753 72d19effbdc4a971bf8d8eae56ddb97a9112a80f
parent 3747 93a0f0ede34f4f7ad5f3decd412516ebb75116ca (current diff)
parent 3752 935f7629444ec35e5e4edfaf4d415297436fdee0 (diff)
child 3754 654b5c59bf68ec0e6b556c35740cfbc7ae7e7a5e
push idunknown
push userunknown
push dateunknown
fixup commit for tag 'moz_ux_20021026'
dbm/makefile.win
dbm/src/Makefile.in
dbm/src/hash.c
new file mode 100644
--- /dev/null
+++ b/dbm/makefile.win
@@ -0,0 +1,38 @@
+# The contents of this file are subject to the Netscape Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/NPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation.  Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): 
+
+DEPTH=..
+
+#//------------------------------------------------------------------------
+#//
+#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
+#// (these must come before the common makefiles are included)
+#// 
+#// DIRS          - There are subdirectories to process
+#//
+#//------------------------------------------------------------------------
+DIRS = include src
+
+#//------------------------------------------------------------------------
+#//
+#// Include the common makefile rules
+#//
+#//------------------------------------------------------------------------
+include <$(DEPTH)\config\rules.mak>
+
--- a/dbm/src/Makefile.in
+++ b/dbm/src/Makefile.in
@@ -58,17 +58,16 @@ endif
 ifeq (,$(filter -DHAVE_SNPRINTF=1,$(DEFS)))
 CSRCS += snprintf.c
 endif
 endif # WINNT
 
 LOCAL_INCLUDES	= -I$(srcdir)/../include
 
 FORCE_STATIC_LIB = 1
-FORCE_USE_PIC = 1
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES		+= -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG)
 ifeq ($(OS_ARCH), Linux)
 DEFINES         += -D_BSD_SOURCE
 endif
 
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -561,21 +561,19 @@ hdestroy(HTAB *hashp)
 
 	if(hashp->filename) {
 #if defined(_WIN32) || defined(_WINDOWS) || defined(XP_OS2)
 		if (hashp->is_temp)
 			(void)unlink(hashp->filename);
 #endif
 		free(hashp->filename);
 	}
-	if (hashp->tmp_buf)
-	    free(hashp->tmp_buf);
-	if (hashp->tmp_key)
-	    free(hashp->tmp_key);
+
 	free(hashp);
+
 	if (save_errno) {
 		errno = save_errno;
 		return (DBM_ERROR);
 	}
 	return (SUCCESS);
 }
 
 #if defined(_WIN32) || defined(_WINDOWS) 
@@ -897,17 +895,17 @@ hash_access(
             if(ovfl_loop_count > MAX_OVERFLOW_HASH_ACCESS_LOOPS)
     			return (DATABASE_CORRUPTED_ERROR);
 
 			/* FOR LOOP INIT */
 			bp = (uint16 *)rbufp->page;
 			n = *bp++;
 			ndx = 1;
 			off = hashp->BSIZE;
-		} else if (bp[1] < REAL_KEY) {
+		                } else if (bp[1] < REAL_KEY) {
 			if ((ndx =
 			    __find_bigpair(hashp, rbufp, ndx, kp, (int)size)) > 0)
 				goto found;
 			if (ndx == -2) {
 				bufp = rbufp;
 				if (!(pageno =
 				    __find_last_page(hashp, &bufp))) {
 					ndx = 0;
--- a/security/nss/lib/smime/cmssiginfo.c
+++ b/security/nss/lib/smime/cmssiginfo.c
@@ -874,16 +874,17 @@ NSS_SMIMESignerInfo_SaveSMIMEProfile(NSS
     CERTCertificate *cert = NULL;
     SECItem *profile = NULL;
     NSSCMSAttribute *attr;
     SECItem *utc_stime = NULL;
     SECItem *ekp;
     CERTCertDBHandle *certdb;
     int save_error;
     SECStatus rv;
+    PRBool must_free_cert = PR_FALSE;
 
     certdb = CERT_GetDefaultCertDB();
 
     /* sanity check - see if verification status is ok (unverified does not count...) */
     if (signerinfo->verificationStatus != NSSCMSVS_GoodSignature)
 	return SECFailure;
 
     /* find preferred encryption cert */
@@ -895,31 +896,34 @@ NSS_SMIMESignerInfo_SaveSMIMEProfile(NSS
 	if (ekp == NULL)
 	    return SECFailure;
 
 	/* we assume that all certs coming with the message have been imported to the */
 	/* temporary database */
 	cert = NSS_SMIMEUtil_GetCertFromEncryptionKeyPreference(certdb, ekp);
 	if (cert == NULL)
 	    return SECFailure;
+	must_free_cert = PR_TRUE;
     }
 
     if (cert == NULL) {
 	/* no preferred cert found?
 	 * find the cert the signerinfo is signed with instead */
 	cert = NSS_CMSSignerInfo_GetSigningCertificate(signerinfo, certdb);
 	if (cert == NULL || cert->emailAddr == NULL)
 	    return SECFailure;
     }
 
     /* verify this cert for encryption (has been verified for signing so far) */    /* don't verify this cert for encryption. It may just be a signing cert.
      * that's OK, we can still save the S/MIME profile. The encryption cert
      * should have already been saved */
 #ifdef notdef
     if (CERT_VerifyCert(certdb, cert, PR_TRUE, certUsageEmailRecipient, PR_Now(), signerinfo->cmsg->pwfn_arg, NULL) != SECSuccess) {
+	if (must_free_cert)
+	    CERT_DestroyCertificate(cert);
 	return SECFailure;
     }
 #endif
 
     /* XXX store encryption cert permanently? */
 
     /*
      * Remember the current error set because we do not care about
@@ -934,16 +938,18 @@ NSS_SMIMESignerInfo_SaveSMIMEProfile(NSS
 	profile = NSS_CMSAttribute_GetValue(attr);
 	attr = NSS_CMSAttributeArray_FindAttrByOidTag(signerinfo->authAttr,
 				       SEC_OID_PKCS9_SIGNING_TIME,
 				       PR_TRUE);
 	utc_stime = NSS_CMSAttribute_GetValue(attr);
     }
 
     rv = CERT_SaveSMimeProfile (cert, profile, utc_stime);
+    if (must_free_cert)
+	CERT_DestroyCertificate(cert);
 
     /*
      * Restore the saved error in case the calls above set a new
      * one that we do not actually care about.
      */
     PORT_SetError (save_error);
 
     return rv;