summaryrefslogtreecommitdiff
path: root/security/nss
diff options
context:
space:
mode:
authorjulien.pierre.bugs%sun.com <devnull@localhost>2005-10-31 18:34:42 +0000
committerjulien.pierre.bugs%sun.com <devnull@localhost>2005-10-31 18:34:42 +0000
commit4cad7f2adc08a5c91f7bae65401809eeb8869c16 (patch)
tree64085ff59a2e3bd7b37a9a9ab6be242c40aebc56 /security/nss
parent8dee7d39cfea89649acebcb72ff7e1c428d879d8 (diff)
downloadnss-hg-4cad7f2adc08a5c91f7bae65401809eeb8869c16.tar.gz
Fix for 314115 - QuickDER modifies SECItem.type while decoding. r=wtchang
Diffstat (limited to 'security/nss')
-rw-r--r--security/nss/lib/util/quickder.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/security/nss/lib/util/quickder.c b/security/nss/lib/util/quickder.c
index 33b251272..29a582147 100644
--- a/security/nss/lib/util/quickder.c
+++ b/security/nss/lib/util/quickder.c
@@ -113,12 +113,9 @@ static SECStatus GetItem(SECItem* src, SECItem* dest, PRBool includeTag)
/* reaching the end of the buffer is not an error */
dest->data = NULL;
dest->len = 0;
- dest->type = siBuffer;
-
return SECSuccess;
}
- dest->type = siBuffer;
dest->data = definite_length_decoder(src->data, src->len, &dest->len,
includeTag);
if (dest->data == NULL)
@@ -862,7 +859,12 @@ static SECStatus DecodeItem(void* dest,
SECItem* destItem = (SECItem*) ((char*)dest + templateEntry->offset);
if (destItem)
{
- *(destItem) = temp;
+ /* we leave the type alone in the destination SECItem.
+ If part of the destination was allocated by the decoder, in
+ cases of POINTER, SET OF and SEQUENCE OF, then type is set to
+ siBuffer due to the use of PORT_ArenaZAlloc*/
+ destItem->data = temp.data;
+ destItem->len = temp.len;
}
else
{