diff options
-rw-r--r-- | source3/libsmb/asn1.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c index 86a2845192..8c986c9588 100644 --- a/source3/libsmb/asn1.c +++ b/source3/libsmb/asn1.c @@ -340,7 +340,11 @@ BOOL asn1_read_OID(ASN1_DATA *data, char **OID) pstring oid_str; fstring el; - if (!asn1_start_tag(data, ASN1_OID)) return False; + *OID = NULL; + + if (!asn1_start_tag(data, ASN1_OID)) { + return False; + } asn1_read_uint8(data, &b); oid_str[0] = 0; @@ -361,7 +365,9 @@ BOOL asn1_read_OID(ASN1_DATA *data, char **OID) asn1_end_tag(data); - *OID = SMB_STRDUP(oid_str); + if (!data->has_error) { + *OID = SMB_STRDUP(oid_str); + } return !data->has_error; } @@ -371,7 +377,9 @@ BOOL asn1_check_OID(ASN1_DATA *data, const char *OID) { char *id; - if (!asn1_read_OID(data, &id)) return False; + if (!asn1_read_OID(data, &id)) { + return False; + } if (strcmp(id, OID) != 0) { data->has_error = True; |