From: Sang Seok Lim Date: Mon, 6 Dec 2004 01:26:38 +0000 (+0000) Subject: Bug fix X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~122 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d6a3dd512ca9dc9ba2c716b61437e7352b3ee30a;p=openldap Bug fix GSER/BER decoders: return code and memory leackage --- diff --git a/contrib/slapd-modules/comp_match/Makefile b/contrib/slapd-modules/comp_match/Makefile index 38c9752cff..7afdef14d5 100644 --- a/contrib/slapd-modules/comp_match/Makefile +++ b/contrib/slapd-modules/comp_match/Makefile @@ -17,7 +17,7 @@ topbuilddir = ../../../../build topsrcdir = ../../.. -snaccdir = /usr/local/snacc +snaccdir = /home/slim/snacc LIBTOOL=$(topbuilddir)/libtool OPT=-g -O2 -DLDAP_COMPONENT diff --git a/contrib/slapd-modules/comp_match/certificate.c b/contrib/slapd-modules/comp_match/certificate.c index 48cb221341..fd0b22a1f6 100644 --- a/contrib/slapd-modules/comp_match/certificate.c +++ b/contrib/slapd-modules/comp_match/certificate.c @@ -1,7 +1,7 @@ /* * certificate.c * "AuthenticationFramework" ASN.1 module encode/decode/extracting/matching/free C src. - * This file was generated by modified eSMACC compiler Tue Nov 23 23:28:16 2004 + * This file was generated by modified eSMACC compiler Sun Dec 5 19:16:59 2004 * The generated files are supposed to be compiled as a module for OpenLDAP Software */ @@ -80,11 +80,13 @@ ComponentAlgorithmIdentifier **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentAlgorithmIdentifier *k, *t, c_temp; @@ -99,7 +101,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, OID_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentOid (mem_op, b, tagId1, elmtLen1, (&k->algorithm), &totalElmtsLen1, mode); + rc = BDecComponentOid (mem_op, b, tagId1, elmtLen1, (&k->algorithm), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->algorithm)->identifier.bv_val = (&k->algorithm)->id_buf; (&k->algorithm)->identifier.bv_len = strlen("algorithm"); strcpy( (&k->algorithm)->identifier.bv_val, "algorithm"); @@ -121,8 +124,9 @@ int mode) if (!seqDone) { - SetAnyTypeByComponentOid ((&k->parameters), (&k->algorithm)); - BDecComponentAnyDefinedBy (mem_op,b, (&k->parameters), &totalElmtsLen1, mode ); + rc = SetAnyTypeByComponentOid ((&k->parameters), (&k->algorithm)); + rc = BDecComponentAnyDefinedBy (mem_op,b, (&k->parameters), &totalElmtsLen1, mode ); + if ( rc != LDAP_SUCCESS ) return rc; (&k->parameters)->identifier.bv_val = (&k->parameters)->id_buf; (&k->parameters)->identifier.bv_len = strlen("parameters"); strcpy( (&k->parameters)->identifier.bv_val, "parameters"); @@ -194,7 +198,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "algorithm", strlen("algorithm") ) == 0 ) { - GDecComponentOid (mem_op, b, (&k->algorithm), bytesDecoded, mode); + rc = GDecComponentOid (mem_op, b, (&k->algorithm), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->algorithm)->identifier.bv_val = peek_head; (&k->algorithm)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -211,8 +216,9 @@ int mode) } } if ( strncmp( peek_head, "parameters", strlen("parameters") ) == 0 ) { - SetAnyTypeByComponentOid ((&k->parameters), (&k->algorithm)); - GDecComponentAnyDefinedBy (mem_op, b, (&k->parameters), bytesDecoded, mode ); + rc = SetAnyTypeByComponentOid ((&k->parameters), (&k->algorithm)); + rc = GDecComponentAnyDefinedBy (mem_op, b, (&k->parameters), bytesDecoded, mode ); + if ( rc != LDAP_SUCCESS ) return rc; (&k->parameters)->identifier.bv_val = peek_head; (&k->parameters)->identifier.bv_len = strLen; } @@ -314,11 +320,13 @@ ComponentTime **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentTime *k, *t, c_temp; @@ -333,7 +341,8 @@ int mode) case MAKE_TAG_ID (UNIV, PRIM, UTCTIME_TAG_CODE): case MAKE_TAG_ID (UNIV, CONS, UTCTIME_TAG_CODE): (k->choiceId) = TIME_UTCTIME; - BDecComponentUTCTime (mem_op, b, tagId0, elmtLen0, (&k->a.utcTime), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + rc = BDecComponentUTCTime (mem_op, b, tagId0, elmtLen0, (&k->a.utcTime), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + if ( rc != LDAP_SUCCESS ) return rc; (k->a.utcTime)->identifier.bv_val = (k->a.utcTime)->id_buf; (k->a.utcTime)->identifier.bv_len = strlen("utcTime"); strcpy( (k->a.utcTime)->identifier.bv_val, "utcTime"); @@ -342,7 +351,8 @@ int mode) case MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE): case MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE): (k->choiceId) = TIME_GENERALIZEDTIME; - BDecComponentGeneralizedTime (mem_op, b, tagId0, elmtLen0, (&k->a.generalizedTime), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + rc = BDecComponentGeneralizedTime (mem_op, b, tagId0, elmtLen0, (&k->a.generalizedTime), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + if ( rc != LDAP_SUCCESS ) return rc; (k->a.generalizedTime)->identifier.bv_val = (k->a.generalizedTime)->id_buf; (k->a.generalizedTime)->identifier.bv_len = strlen("generalizedTime"); strcpy( (k->a.generalizedTime)->identifier.bv_val, "generalizedTime"); @@ -495,11 +505,13 @@ ComponentExtension **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentExtension *k, *t, c_temp; @@ -514,7 +526,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, OID_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentOid (mem_op, b, tagId1, elmtLen1, (&k->extnID), &totalElmtsLen1, mode); + rc = BDecComponentOid (mem_op, b, tagId1, elmtLen1, (&k->extnID), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->extnID)->identifier.bv_val = (&k->extnID)->id_buf; (&k->extnID)->identifier.bv_len = strlen("extnID"); strcpy( (&k->extnID)->identifier.bv_val, "extnID"); @@ -529,7 +542,8 @@ int mode) (tagId1 == MAKE_TAG_ID (UNIV, CONS, OCTETSTRING_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentOcts (mem_op, b, tagId1, elmtLen1, (&k->extnValue), &totalElmtsLen1, mode); + rc = BDecComponentOcts (mem_op, b, tagId1, elmtLen1, (&k->extnValue), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->extnValue)->identifier.bv_val = (&k->extnValue)->id_buf; (&k->extnValue)->identifier.bv_len = strlen("extnValue"); strcpy( (&k->extnValue)->identifier.bv_val, "extnValue"); @@ -604,7 +618,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "extnID", strlen("extnID") ) == 0 ) { - GDecComponentOid (mem_op, b, (&k->extnID), bytesDecoded, mode); + rc = GDecComponentOid (mem_op, b, (&k->extnID), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->extnID)->identifier.bv_val = peek_head; (&k->extnID)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -621,7 +636,8 @@ int mode) } } if ( strncmp( peek_head, "extnValue", strlen("extnValue") ) == 0 ) { - GDecComponentOcts (mem_op, b, (&k->extnValue), bytesDecoded, mode); + rc = GDecComponentOcts (mem_op, b, (&k->extnValue), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->extnValue)->identifier.bv_val = peek_head; (&k->extnValue)->identifier.bv_len = strLen; } @@ -705,11 +721,13 @@ ComponentAttributeTypeAndValue **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentAttributeTypeAndValue *k, *t, c_temp; @@ -724,7 +742,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, OID_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentAttributeType (mem_op, b, tagId1, elmtLen1, (&k->type), &totalElmtsLen1, mode); + rc = BDecComponentAttributeType (mem_op, b, tagId1, elmtLen1, (&k->type), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->type)->identifier.bv_val = (&k->type)->id_buf; (&k->type)->identifier.bv_len = strlen("type"); strcpy( (&k->type)->identifier.bv_val, "type"); @@ -735,8 +754,9 @@ int mode) { - SetAnyTypeByComponentOid ((&k->value), (&k->type)); - BDecComponentAnyDefinedBy (mem_op,b, (&k->value), &totalElmtsLen1, mode ); + rc = SetAnyTypeByComponentOid ((&k->value), (&k->type)); + rc = BDecComponentAnyDefinedBy (mem_op,b, (&k->value), &totalElmtsLen1, mode ); + if ( rc != LDAP_SUCCESS ) return rc; (&k->value)->identifier.bv_val = (&k->value)->id_buf; (&k->value)->identifier.bv_len = strlen("value"); strcpy( (&k->value)->identifier.bv_val, "value"); @@ -808,7 +828,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "type", strlen("type") ) == 0 ) { - GDecComponentAttributeType (mem_op, b, (&k->type), bytesDecoded, mode); + rc = GDecComponentAttributeType (mem_op, b, (&k->type), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->type)->identifier.bv_val = peek_head; (&k->type)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -825,8 +846,9 @@ int mode) } } if ( strncmp( peek_head, "value", strlen("value") ) == 0 ) { - SetAnyTypeByComponentOid ((&k->value), (&k->type)); - GDecComponentAnyDefinedBy (mem_op, b, (&k->value), bytesDecoded, mode ); + rc = SetAnyTypeByComponentOid ((&k->value), (&k->type)); + rc = GDecComponentAnyDefinedBy (mem_op, b, (&k->value), bytesDecoded, mode ); + if ( rc != LDAP_SUCCESS ) return rc; (&k->value)->identifier.bv_val = peek_head; (&k->value)->identifier.bv_len = strLen; } @@ -913,7 +935,7 @@ ComponentValidity **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; @@ -921,6 +943,8 @@ int mode) AsnLen totalElmtsLen2 = 0; AsnLen elmtLen2; AsnTag tagId2; + int old_mode = mode; + int rc; ComponentValidity *k, *t, c_temp; @@ -938,7 +962,8 @@ int mode) (tagId1 == MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->notBefore), &totalElmtsLen1, mode); + rc = BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->notBefore), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->notBefore)->identifier.bv_val = (k->notBefore)->id_buf; (k->notBefore)->identifier.bv_len = strlen("notBefore"); strcpy( (k->notBefore)->identifier.bv_val, "notBefore"); @@ -955,7 +980,8 @@ int mode) (tagId1 == MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->notAfter), &totalElmtsLen1, mode); + rc = BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->notAfter), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->notAfter)->identifier.bv_val = (k->notAfter)->id_buf; (k->notAfter)->identifier.bv_len = strlen("notAfter"); strcpy( (k->notAfter)->identifier.bv_val, "notAfter"); @@ -1030,7 +1056,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "notBefore", strlen("notBefore") ) == 0 ) { - GDecComponentTime (mem_op, b, (&k->notBefore), bytesDecoded, mode); + rc = GDecComponentTime (mem_op, b, (&k->notBefore), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->notBefore)->identifier.bv_val = peek_head; ( k->notBefore)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -1047,7 +1074,8 @@ int mode) } } if ( strncmp( peek_head, "notAfter", strlen("notAfter") ) == 0 ) { - GDecComponentTime (mem_op, b, (&k->notAfter), bytesDecoded, mode); + rc = GDecComponentTime (mem_op, b, (&k->notAfter), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->notAfter)->identifier.bv_val = peek_head; ( k->notAfter)->identifier.bv_len = strLen; } @@ -1132,11 +1160,13 @@ ComponentSubjectPublicKeyInfo **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentSubjectPublicKeyInfo *k, *t, c_temp; @@ -1151,7 +1181,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->algorithm), &totalElmtsLen1, mode); + rc = BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->algorithm), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->algorithm)->identifier.bv_val = (k->algorithm)->id_buf; (k->algorithm)->identifier.bv_len = strlen("algorithm"); strcpy( (k->algorithm)->identifier.bv_val, "algorithm"); @@ -1166,7 +1197,8 @@ int mode) (tagId1 == MAKE_TAG_ID (UNIV, CONS, BITSTRING_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentBits (mem_op, b, tagId1, elmtLen1, (&k->subjectPublicKey), &totalElmtsLen1, mode); + rc = BDecComponentBits (mem_op, b, tagId1, elmtLen1, (&k->subjectPublicKey), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->subjectPublicKey)->identifier.bv_val = (&k->subjectPublicKey)->id_buf; (&k->subjectPublicKey)->identifier.bv_len = strlen("subjectPublicKey"); strcpy( (&k->subjectPublicKey)->identifier.bv_val, "subjectPublicKey"); @@ -1241,7 +1273,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "algorithm", strlen("algorithm") ) == 0 ) { - GDecComponentAlgorithmIdentifier (mem_op, b, (&k->algorithm), bytesDecoded, mode); + rc = GDecComponentAlgorithmIdentifier (mem_op, b, (&k->algorithm), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->algorithm)->identifier.bv_val = peek_head; ( k->algorithm)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -1258,7 +1291,8 @@ int mode) } } if ( strncmp( peek_head, "subjectPublicKey", strlen("subjectPublicKey") ) == 0 ) { - GDecComponentBits (mem_op, b, (&k->subjectPublicKey), bytesDecoded, mode); + rc = GDecComponentBits (mem_op, b, (&k->subjectPublicKey), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->subjectPublicKey)->identifier.bv_val = peek_head; (&k->subjectPublicKey)->identifier.bv_len = strLen; } @@ -1390,11 +1424,13 @@ ComponentExtensions **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentExtensions *k, *t, c_temp; @@ -1418,8 +1454,9 @@ int mode) if ((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - tmpVar = (ComponentExtension**) AsnListAppend (&k->comp_list); - BDecComponentExtension (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + tmpVar = (ComponentExtension**) CompAsnListAppend (mem_op,&k->comp_list); + rc = BDecComponentExtension (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of tag check if */ else /* wrong tag */ { @@ -1492,12 +1529,13 @@ int mode) if( !(*peek_head == '{' || *peek_head ==',') ) { return LDAP_PROTOCOL_ERROR; } - tmpVar = (ComponentExtension**) AsnListAppend (&k->comp_list); + tmpVar = (ComponentExtension**) CompAsnListAppend (mem_op, &k->comp_list); if ( tmpVar == NULL ) { Asn1Error("Error during Reading{ in encoding"); return LDAP_PROTOCOL_ERROR; } - GDecComponentExtension (mem_op, b, tmpVar, bytesDecoded, mode); + rc = GDecComponentExtension (mem_op, b, tmpVar, bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of for */ if( !(old_mode & DEC_ALLOC_MODE_1) ) { @@ -1629,11 +1667,13 @@ ComponentRelativeDistinguishedName **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentRelativeDistinguishedName *k, *t, c_temp; @@ -1657,8 +1697,9 @@ int mode) if ((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - tmpVar = (ComponentAttributeTypeAndValue**) AsnListAppend (&k->comp_list); - BDecComponentAttributeTypeAndValue (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + tmpVar = (ComponentAttributeTypeAndValue**) CompAsnListAppend (mem_op,&k->comp_list); + rc = BDecComponentAttributeTypeAndValue (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of tag check if */ else /* wrong tag */ { @@ -1683,7 +1724,7 @@ int mode) t->comp_desc->cd_free = (comp_free_func*)NULL; t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentRelativeDistinguishedName; t->comp_desc->cd_type = ASN_COMPOSITE; - t->comp_desc->cd_type_id = RelativeDistinguishedName ; + t->comp_desc->cd_type_id = RelativeDistinguishedName; t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentRelativeDistinguishedName; (*bytesDecoded) += totalElmtsLen1; return LDAP_SUCCESS; @@ -1731,12 +1772,13 @@ int mode) if( !(*peek_head == '{' || *peek_head ==',') ) { return LDAP_PROTOCOL_ERROR; } - tmpVar = (ComponentAttributeTypeAndValue**) AsnListAppend (&k->comp_list); + tmpVar = (ComponentAttributeTypeAndValue**) CompAsnListAppend (mem_op, &k->comp_list); if ( tmpVar == NULL ) { Asn1Error("Error during Reading{ in encoding"); return LDAP_PROTOCOL_ERROR; } - GDecComponentAttributeTypeAndValue (mem_op, b, tmpVar, bytesDecoded, mode); + rc = GDecComponentAttributeTypeAndValue (mem_op, b, tmpVar, bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of for */ if( !(old_mode & DEC_ALLOC_MODE_1) ) { @@ -1755,7 +1797,7 @@ int mode) t->comp_desc->cd_free = (comp_free_func*)NULL; t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentRelativeDistinguishedName; t->comp_desc->cd_type = ASN_COMPOSITE; - t->comp_desc->cd_type_id = RelativeDistinguishedName ; + t->comp_desc->cd_type_id = RelativeDistinguishedName; t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentRelativeDistinguishedName; return LDAP_SUCCESS; } /* GDecRelativeDistinguishedNameContent */ @@ -1859,11 +1901,13 @@ ComponentRDNSequence **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentRDNSequence *k, *t, c_temp; @@ -1887,8 +1931,9 @@ int mode) if ((tagId1 == MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - tmpVar = (ComponentRelativeDistinguishedName**) AsnListAppend (&k->comp_list); - BDecComponentRelativeDistinguishedName (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + tmpVar = (ComponentRelativeDistinguishedName**) CompAsnListAppend (mem_op,&k->comp_list); + rc = BDecComponentRelativeDistinguishedName (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of tag check if */ else /* wrong tag */ { @@ -1961,12 +2006,13 @@ int mode) if( !(*peek_head == '{' || *peek_head ==',') ) { return LDAP_PROTOCOL_ERROR; } - tmpVar = (ComponentRelativeDistinguishedName**) AsnListAppend (&k->comp_list); + tmpVar = (ComponentRelativeDistinguishedName**) CompAsnListAppend (mem_op, &k->comp_list); if ( tmpVar == NULL ) { Asn1Error("Error during Reading{ in encoding"); return LDAP_PROTOCOL_ERROR; } - GDecComponentRelativeDistinguishedName (mem_op, b, tmpVar, bytesDecoded, mode); + rc = GDecComponentRelativeDistinguishedName (mem_op, b, tmpVar, bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; } /* end of for */ if( !(old_mode & DEC_ALLOC_MODE_1) ) { @@ -2046,11 +2092,13 @@ ComponentName **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentName *k, *t, c_temp; @@ -2064,7 +2112,8 @@ int mode) { case MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE): (k->choiceId) = NAME_RDNSEQUENCE; - BDecComponentRDNSequence (mem_op, b, tagId0, elmtLen0, (&k->a.rdnSequence), &totalElmtsLen1, mode); + rc = BDecComponentRDNSequence (mem_op, b, tagId0, elmtLen0, (&k->a.rdnSequence), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->a.rdnSequence)->identifier.bv_val = (k->a.rdnSequence)->id_buf; (k->a.rdnSequence)->identifier.bv_len = strlen("rdnSequence"); strcpy( (k->a.rdnSequence)->identifier.bv_val, "rdnSequence"); @@ -2298,7 +2347,7 @@ ComponentTBSCertificate **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; @@ -2306,6 +2355,8 @@ int mode) AsnLen totalElmtsLen2 = 0; AsnLen elmtLen2; AsnTag tagId2; + int old_mode = mode; + int rc; ComponentTBSCertificate *k, *t, c_temp; @@ -2329,7 +2380,8 @@ int mode) } elmtLen2 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentVersion (mem_op, b, tagId2, elmtLen2, (&k->version), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + rc = BDecComponentVersion (mem_op, b, tagId2, elmtLen2, (&k->version), &totalElmtsLen1, DEC_ALLOC_MODE_0 ); + if ( rc != LDAP_SUCCESS ) return rc; (k->version)->identifier.bv_val = (k->version)->id_buf; (k->version)->identifier.bv_len = strlen("version"); strcpy( (k->version)->identifier.bv_val, "version"); @@ -2342,7 +2394,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, INTEGER_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentCertificateSerialNumber (mem_op, b, tagId1, elmtLen1, (&k->serialNumber), &totalElmtsLen1, mode); + rc = BDecComponentCertificateSerialNumber (mem_op, b, tagId1, elmtLen1, (&k->serialNumber), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->serialNumber)->identifier.bv_val = (&k->serialNumber)->id_buf; (&k->serialNumber)->identifier.bv_len = strlen("serialNumber"); strcpy( (&k->serialNumber)->identifier.bv_val, "serialNumber"); @@ -2356,7 +2409,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode); + rc = BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->signature)->identifier.bv_val = (k->signature)->id_buf; (k->signature)->identifier.bv_len = strlen("signature"); strcpy( (k->signature)->identifier.bv_val, "signature"); @@ -2370,7 +2424,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentName (mem_op, b, tagId1, elmtLen1, (&k->issuer), &totalElmtsLen1, mode); + rc = BDecComponentName (mem_op, b, tagId1, elmtLen1, (&k->issuer), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->issuer)->identifier.bv_val = (k->issuer)->id_buf; (k->issuer)->identifier.bv_len = strlen("issuer"); strcpy( (k->issuer)->identifier.bv_val, "issuer"); @@ -2384,7 +2439,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentValidity (mem_op, b, tagId1, elmtLen1, (&k->validity), &totalElmtsLen1, mode); + rc = BDecComponentValidity (mem_op, b, tagId1, elmtLen1, (&k->validity), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->validity)->identifier.bv_val = (k->validity)->id_buf; (k->validity)->identifier.bv_len = strlen("validity"); strcpy( (k->validity)->identifier.bv_val, "validity"); @@ -2398,7 +2454,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentName (mem_op, b, tagId1, elmtLen1, (&k->subject), &totalElmtsLen1, mode); + rc = BDecComponentName (mem_op, b, tagId1, elmtLen1, (&k->subject), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->subject)->identifier.bv_val = (k->subject)->id_buf; (k->subject)->identifier.bv_len = strlen("subject"); strcpy( (k->subject)->identifier.bv_val, "subject"); @@ -2412,7 +2469,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentSubjectPublicKeyInfo (mem_op, b, tagId1, elmtLen1, (&k->subjectPublicKeyInfo), &totalElmtsLen1, mode); + rc = BDecComponentSubjectPublicKeyInfo (mem_op, b, tagId1, elmtLen1, (&k->subjectPublicKeyInfo), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->subjectPublicKeyInfo)->identifier.bv_val = (k->subjectPublicKeyInfo)->id_buf; (k->subjectPublicKeyInfo)->identifier.bv_len = strlen("subjectPublicKeyInfo"); strcpy( (k->subjectPublicKeyInfo)->identifier.bv_val, "subjectPublicKeyInfo"); @@ -2438,7 +2496,8 @@ int mode) (tagId1 == MAKE_TAG_ID (CNTX, CONS, 1)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentUniqueIdentifier (mem_op, b, tagId1, elmtLen1, (&k->issuerUniqueIdentifier), &totalElmtsLen1, mode); + rc = BDecComponentUniqueIdentifier (mem_op, b, tagId1, elmtLen1, (&k->issuerUniqueIdentifier), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->issuerUniqueIdentifier)->identifier.bv_val = (&k->issuerUniqueIdentifier)->id_buf; (&k->issuerUniqueIdentifier)->identifier.bv_len = strlen("issuerUniqueIdentifier"); strcpy( (&k->issuerUniqueIdentifier)->identifier.bv_val, "issuerUniqueIdentifier"); @@ -2461,7 +2520,8 @@ int mode) (tagId1 == MAKE_TAG_ID (CNTX, CONS, 2)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentUniqueIdentifier (mem_op, b, tagId1, elmtLen1, (&k->subjectUniqueIdentifier), &totalElmtsLen1, mode); + rc = BDecComponentUniqueIdentifier (mem_op, b, tagId1, elmtLen1, (&k->subjectUniqueIdentifier), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->subjectUniqueIdentifier)->identifier.bv_val = (&k->subjectUniqueIdentifier)->id_buf; (&k->subjectUniqueIdentifier)->identifier.bv_len = strlen("subjectUniqueIdentifier"); strcpy( (&k->subjectUniqueIdentifier)->identifier.bv_val, "subjectUniqueIdentifier"); @@ -2492,7 +2552,8 @@ int mode) } elmtLen2 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentExtensions (mem_op, b, tagId2, elmtLen2, (&k->extensions), &totalElmtsLen1, mode); + rc = BDecComponentExtensions (mem_op, b, tagId2, elmtLen2, (&k->extensions), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->extensions)->identifier.bv_val = (k->extensions)->id_buf; (k->extensions)->identifier.bv_len = strlen("extensions"); strcpy( (k->extensions)->identifier.bv_val, "extensions"); @@ -2570,7 +2631,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "version", strlen("version") ) == 0 ) { - GDecComponentVersion (mem_op, b, (&k->version), bytesDecoded, DEC_ALLOC_MODE_0 ); + rc = GDecComponentVersion (mem_op, b, (&k->version), bytesDecoded, DEC_ALLOC_MODE_0 ); + if ( rc != LDAP_SUCCESS ) return rc; ( k->version)->identifier.bv_val = peek_head; ( k->version)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2590,7 +2652,8 @@ int mode) (k->version)->value = 0; } if ( strncmp( peek_head, "serialNumber", strlen("serialNumber") ) == 0 ) { - GDecComponentCertificateSerialNumber (mem_op, b, (&k->serialNumber), bytesDecoded, mode); + rc = GDecComponentCertificateSerialNumber (mem_op, b, (&k->serialNumber), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->serialNumber)->identifier.bv_val = peek_head; (&k->serialNumber)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2607,7 +2670,8 @@ int mode) } } if ( strncmp( peek_head, "signature", strlen("signature") ) == 0 ) { - GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signature), bytesDecoded, mode); + rc = GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signature), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->signature)->identifier.bv_val = peek_head; ( k->signature)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2624,7 +2688,8 @@ int mode) } } if ( strncmp( peek_head, "issuer", strlen("issuer") ) == 0 ) { - GDecComponentName (mem_op, b, (&k->issuer), bytesDecoded, mode); + rc = GDecComponentName (mem_op, b, (&k->issuer), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->issuer)->identifier.bv_val = peek_head; ( k->issuer)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2641,7 +2706,8 @@ int mode) } } if ( strncmp( peek_head, "validity", strlen("validity") ) == 0 ) { - GDecComponentValidity (mem_op, b, (&k->validity), bytesDecoded, mode); + rc = GDecComponentValidity (mem_op, b, (&k->validity), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->validity)->identifier.bv_val = peek_head; ( k->validity)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2658,7 +2724,8 @@ int mode) } } if ( strncmp( peek_head, "subject", strlen("subject") ) == 0 ) { - GDecComponentName (mem_op, b, (&k->subject), bytesDecoded, mode); + rc = GDecComponentName (mem_op, b, (&k->subject), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->subject)->identifier.bv_val = peek_head; ( k->subject)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2675,7 +2742,8 @@ int mode) } } if ( strncmp( peek_head, "subjectPublicKeyInfo", strlen("subjectPublicKeyInfo") ) == 0 ) { - GDecComponentSubjectPublicKeyInfo (mem_op, b, (&k->subjectPublicKeyInfo), bytesDecoded, mode); + rc = GDecComponentSubjectPublicKeyInfo (mem_op, b, (&k->subjectPublicKeyInfo), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->subjectPublicKeyInfo)->identifier.bv_val = peek_head; ( k->subjectPublicKeyInfo)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2692,7 +2760,8 @@ int mode) } } if ( strncmp( peek_head, "issuerUniqueIdentifier", strlen("issuerUniqueIdentifier") ) == 0 ) { - GDecComponentUniqueIdentifier (mem_op, b, (&k->issuerUniqueIdentifier), bytesDecoded, mode); + rc = GDecComponentUniqueIdentifier (mem_op, b, (&k->issuerUniqueIdentifier), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->issuerUniqueIdentifier)->identifier.bv_val = peek_head; (&k->issuerUniqueIdentifier)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2709,7 +2778,8 @@ int mode) } } if ( strncmp( peek_head, "subjectUniqueIdentifier", strlen("subjectUniqueIdentifier") ) == 0 ) { - GDecComponentUniqueIdentifier (mem_op, b, (&k->subjectUniqueIdentifier), bytesDecoded, mode); + rc = GDecComponentUniqueIdentifier (mem_op, b, (&k->subjectUniqueIdentifier), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->subjectUniqueIdentifier)->identifier.bv_val = peek_head; (&k->subjectUniqueIdentifier)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2726,7 +2796,8 @@ int mode) } } if ( strncmp( peek_head, "extensions", strlen("extensions") ) == 0 ) { - GDecComponentExtensions (mem_op, b, (&k->extensions), bytesDecoded, mode); + rc = GDecComponentExtensions (mem_op, b, (&k->extensions), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->extensions)->identifier.bv_val = peek_head; ( k->extensions)->identifier.bv_len = strLen; } @@ -2822,11 +2893,13 @@ ComponentCertificate **v _AND_ AsnLen *bytesDecoded _AND_ int mode) { - int seqDone = FALSE, old_mode = mode; + int seqDone = FALSE; AsnLen totalElmtsLen1 = 0; AsnLen elmtLen1; AsnTag tagId1; int mandatoryElmtCount1 = 0; + int old_mode = mode; + int rc; ComponentCertificate *k, *t, c_temp; @@ -2841,7 +2914,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentTBSCertificate (mem_op, b, tagId1, elmtLen1, (&k->tbsCertificate), &totalElmtsLen1, mode); + rc = BDecComponentTBSCertificate (mem_op, b, tagId1, elmtLen1, (&k->tbsCertificate), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->tbsCertificate)->identifier.bv_val = (k->tbsCertificate)->id_buf; (k->tbsCertificate)->identifier.bv_len = strlen("tbsCertificate"); strcpy( (k->tbsCertificate)->identifier.bv_val, "tbsCertificate"); @@ -2855,7 +2929,8 @@ int mode) if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signatureAlgorithm), &totalElmtsLen1, mode); + rc = BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signatureAlgorithm), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (k->signatureAlgorithm)->identifier.bv_val = (k->signatureAlgorithm)->id_buf; (k->signatureAlgorithm)->identifier.bv_len = strlen("signatureAlgorithm"); strcpy( (k->signatureAlgorithm)->identifier.bv_val, "signatureAlgorithm"); @@ -2870,7 +2945,8 @@ int mode) (tagId1 == MAKE_TAG_ID (UNIV, CONS, BITSTRING_TAG_CODE)))) { elmtLen1 = BDecLen (b, &totalElmtsLen1 ); - BDecComponentBits (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode); + rc = BDecComponentBits (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->signature)->identifier.bv_val = (&k->signature)->id_buf; (&k->signature)->identifier.bv_len = strlen("signature"); strcpy( (&k->signature)->identifier.bv_val, "signature"); @@ -2945,7 +3021,8 @@ int mode) return LDAP_PROTOCOL_ERROR; } if ( strncmp( peek_head, "tbsCertificate", strlen("tbsCertificate") ) == 0 ) { - GDecComponentTBSCertificate (mem_op, b, (&k->tbsCertificate), bytesDecoded, mode); + rc = GDecComponentTBSCertificate (mem_op, b, (&k->tbsCertificate), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->tbsCertificate)->identifier.bv_val = peek_head; ( k->tbsCertificate)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2962,7 +3039,8 @@ int mode) } } if ( strncmp( peek_head, "signatureAlgorithm", strlen("signatureAlgorithm") ) == 0 ) { - GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signatureAlgorithm), bytesDecoded, mode); + rc = GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signatureAlgorithm), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; ( k->signatureAlgorithm)->identifier.bv_val = peek_head; ( k->signatureAlgorithm)->identifier.bv_len = strLen; if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){ @@ -2979,7 +3057,8 @@ int mode) } } if ( strncmp( peek_head, "signature", strlen("signature") ) == 0 ) { - GDecComponentBits (mem_op, b, (&k->signature), bytesDecoded, mode); + rc = GDecComponentBits (mem_op, b, (&k->signature), bytesDecoded, mode); + if ( rc != LDAP_SUCCESS ) return rc; (&k->signature)->identifier.bv_val = peek_head; (&k->signature)->identifier.bv_len = strLen; } diff --git a/contrib/slapd-modules/comp_match/certificate.h b/contrib/slapd-modules/comp_match/certificate.h index 660a075e1f..13503ea7f1 100644 --- a/contrib/slapd-modules/comp_match/certificate.h +++ b/contrib/slapd-modules/comp_match/certificate.h @@ -3,7 +3,7 @@ /* * certificate.h * "AuthenticationFramework" ASN.1 module encode/decode/extracting/matching/free C src. - * This file was generated by modified eSMACC compiler Tue Nov 23 23:28:16 2004 + * This file was generated by modified eSMACC compiler Sun Dec 5 19:16:59 2004 * The generated files are strongly encouraged to be * compiled as a module for OpenLDAP Software */ diff --git a/contrib/slapd-modules/comp_match/componentlib.c b/contrib/slapd-modules/comp_match/componentlib.c index 013d309f71..55bfef3a69 100644 --- a/contrib/slapd-modules/comp_match/componentlib.c +++ b/contrib/slapd-modules/comp_match/componentlib.c @@ -1935,7 +1935,7 @@ BDecComponentVisibleString ( void* mem_op, GenBuf *b, AsnTag tagId, AsnLen len, /* * Routines for handling an ANY DEFINED Type */ -void +int SetAnyTypeByComponentOid ( ComponentAny *v, ComponentOid *id ) { Hash hash; void *anyInfo; @@ -1953,6 +1953,7 @@ SetAnyTypeByComponentOid ( ComponentAny *v, ComponentOid *id ) { * Yet-to-be-Implemented */ } + return LDAP_SUCCESS; } void @@ -1980,6 +1981,8 @@ BDecComponentAny ( void* mem_op, GenBuf *b, ComponentAny *result, AsnLen *bytesD ComponentAny *k, **k2; k = (ComponentAny*) result; + + if ( !k ) return (-1); if ( mode & DEC_ALLOC_MODE_0 ) { k2 = (ComponentAny**) result;