VirtualBox

Changeset 52563 in vbox for trunk/src


Ignore:
Timestamp:
Sep 2, 2014 8:36:53 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95829
Message:

asn1: clear stuff on decode failure.

Location:
trunk/src/VBox/Runtime/common/asn1
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-boolean-decode.cpp

    r51770 r52563  
    6969        }
    7070    }
     71    RT_ZERO(*pThis);
    7172    return rc;
    7273}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp

    r51770 r52563  
    4444        return VINF_SUCCESS;
    4545    }
     46    RT_ZERO(*pThis);
    4647    return rc;
    4748}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp

    r51770 r52563  
    7777                    break;
    7878                case ASN1_TAG_SEQUENCE:
     79                    RT_ZERO(*pDynType);
    7980                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 SEQUENCE shall be constructed.");
    8081                case ASN1_TAG_SET:
     82                    RT_ZERO(*pDynType);
    8183                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 SET shall be constructed.");
    8284                case ASN1_TAG_OID:
     
    108110
    109111                default:
     112                    RT_ZERO(*pDynType);
    110113                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_TAG_NOT_IMPL,
    111114                                               "Primitive tag %u (%#x) not implemented.",
     
    117120            {
    118121                case ASN1_TAG_BOOLEAN:
     122                    RT_ZERO(*pDynType);
    119123                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 BOOLEAN shall be primitive.");
    120124                case ASN1_TAG_INTEGER:
     125                    RT_ZERO(*pDynType);
    121126                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 BOOLEAN shall be primitive.");
    122127                case ASN1_TAG_ENUMERATED:
     128                    RT_ZERO(*pDynType);
    123129                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 ENUMERATED shall be primitive.");
    124130                case ASN1_TAG_REAL:
     131                    RT_ZERO(*pDynType);
    125132                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 REAL shall be primitive.");
    126133                case ASN1_TAG_BIT_STRING:
     
    131138                    break;
    132139                case ASN1_TAG_NULL:
     140                    RT_ZERO(*pDynType);
    133141                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 NULL shall be primitive.");
    134142                case ASN1_TAG_SEQUENCE:
     
    153161                    break;
    154162                case ASN1_TAG_OID:
     163                    RT_ZERO(*pDynType);
    155164                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 OBJECT ID shall be primitive.");
    156165                case ASN1_TAG_RELATIVE_OID:
     166                    RT_ZERO(*pDynType);
    157167                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_BAD_TAG, "ASN.1 RELATIVE OID shall be primitive.");
    158168
     
    175185
    176186                default:
     187                    RT_ZERO(*pDynType);
    177188                    return RTAsn1CursorSetInfo(pCursor, VERR_ASN1_DYNTYPE_TAG_NOT_IMPL,
    178189                                               "Constructed tag %u (%#x) not implemented.",
     
    223234                AssertFailedReturn(VERR_INTERNAL_ERROR_4);
    224235        }
     236        if (RT_SUCCESS(rc))
     237            return rc;
    225238    }
     239    RT_ZERO(*pDynType);
    226240    return rc;
    227241}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-integer-decode.cpp

    r51770 r52563  
    6767        }
    6868    }
     69    RT_ZERO(*pThis);
    6970    return rc;
    7071}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-null-decode.cpp

    r51770 r52563  
    5757        }
    5858    }
     59    RT_ZERO(*pThis);
    5960    return rc;
    6061}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp

    r51773 r52563  
    349349        }
    350350    }
     351    RT_ZERO(*pThis);
    351352    return rc;
    352353}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-octetstring-decode.cpp

    r51770 r52563  
    6666                                     pszErrorTag, pThis->Asn1Core.fClass, pThis->Asn1Core.uTag);
    6767    }
     68    RT_ZERO(*pThis);
    6869    return rc;
    6970}
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-string-decode.cpp

    r51770 r52563  
    163163        }
    164164    }
     165    RT_ZERO(*pThis);
    165166    return rc;
    166167}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette