From ce669491168a42a12cc5a1c53caebf6701b63cbf Mon Sep 17 00:00:00 2001 From: "thayes%netscape.com" Date: Thu, 6 Apr 2000 00:26:24 +0000 Subject: [PATCH] Initialize SECItem values in ATOB_ routines to avoid PR_Assert for previously allocated data buffers in the NSS versions of these routines. --- security/nss/lib/util/nssb64d.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/security/nss/lib/util/nssb64d.c b/security/nss/lib/util/nssb64d.c index fe7ac391b59..090fdac6848 100644 --- a/security/nss/lib/util/nssb64d.c +++ b/security/nss/lib/util/nssb64d.c @@ -34,7 +34,7 @@ /* * Base64 decoding (ascii to binary). * - * $Id: nssb64d.c,v 1.1 2000-03-31 19:38:17 relyea%netscape.com Exp $ + * $Id: nssb64d.c,v 1.2 2000-04-06 00:26:24 thayes%netscape.com Exp $ */ #include "nssb64.h" @@ -814,6 +814,9 @@ ATOB_AsciiToData(const char *string, unsigned int *lenp) { SECItem binary_item, *dummy; + binary_item.data = NULL; + binary_item.len = 0; + dummy = NSSBase64_DecodeBuffer (NULL, &binary_item, string, (PRUint32) PORT_Strlen(string)); if (dummy == NULL) @@ -833,6 +836,9 @@ ATOB_ConvertAsciiToItem(SECItem *binary_item, char *ascii) { SECItem *dummy; + binary_item->data = NULL; + binary_item->len = 0; + dummy = NSSBase64_DecodeBuffer (NULL, binary_item, ascii, (PRUint32) PORT_Strlen(ascii));