Some bug fixes found while debugging a different bug.
authornelsonb%netscape.com
Wed, 21 Nov 2001 23:33:26 +0000
changeset 2362 fcd8ab3720a048246e18421fb854c48936725248
parent 2361 8dd78bdc98fd6982b197c46f18155fab6818a2b9
child 2363 e41ac1061dfdee492eeaf28f95bfb0e09deb447b
push idunknown
push userunknown
push dateunknown
Some bug fixes found while debugging a different bug.
security/nss/cmd/certcgi/certcgi.c
--- a/security/nss/cmd/certcgi/certcgi.c
+++ b/security/nss/cmd/certcgi/certcgi.c
@@ -1791,17 +1791,17 @@ MakeNameConstraints(Pair             *da
 	    }
 	    last_excluded->l.next = &(current->l);
 	    current->l.prev = &(last_excluded->l);
 	    last_excluded = current;
 	}
 	constraint = find_field(data, which, PR_TRUE);
 	if (constraint != NULL) {
 	    current = (CERTNameConstraint *) PORT_ZAlloc(sizeof(CERTNameConstraint));
-	    if (current = NULL) {
+	    if (current == NULL) {
 		error_allocate();
 	    }
 	}
     }
     if (NameConstraints->permited != NULL) {
 	last_permited->l.next = &(NameConstraints->permited->l);
 	NameConstraints->permited->l.prev = &(last_permited->l);
     }
@@ -1888,19 +1888,21 @@ AddAltName(void              *extHandle,
 	}
     }
     if (which != NULL) {
 	PORT_Free(which);
     }
     if (issuerCert != NULL) {
 	CERT_DestroyCertificate(issuerCert);
     }
+#if 0
     if (arena != NULL) {
 	PORT_ArenaRelease (arena, mark);
     }
+#endif
     return rv;
 }
 
 
 static SECStatus
 AddNameConstraints(void  *extHandle,
 		   Pair  *data)
 {
@@ -2403,17 +2405,18 @@ main(int argc, char **argv)
     certChain = SEC_PKCS7CreateCertsOnly (cert, PR_TRUE, handle);
     if (certChain == NULL) {
 	error_out("ERROR: No certificates in cert chain");
     }
     encodedCertChain = SEC_PKCS7EncodeItem (NULL, NULL, certChain, NULL, NULL, 
 					    NULL);
     if (encodedCertChain) {
 #if !defined(FILEOUT)
-	printf("Content-type: application/x-x509-user-cert\n\n");
+	printf("Content-type: application/x-x509-user-cert\r\n");
+	printf("Content-length: %d\r\n\r\n", encodedCertChain->len);
 	fwrite (encodedCertChain->data, 1, encodedCertChain->len, stdout);
 #else
 	fwrite (encodedCertChain->data, 1, encodedCertChain->len, outfile);
 #endif
 
     } else {
 	error_out("Error: Unable to DER encode certificate");
     }