diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clispnego.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index a962953b90..a4fcfa5d9a 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -247,13 +247,23 @@ BOOL spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket) { BOOL ret; ASN1_DATA data; + int data_remaining; asn1_load(&data, blob); asn1_start_tag(&data, ASN1_APPLICATION(0)); asn1_check_OID(&data, OID_KERBEROS5); asn1_check_BOOLEAN(&data, 0); - *ticket = data_blob(data.data, asn1_tag_remaining(&data)); - asn1_read(&data, ticket->data, ticket->length); + + data_remaining = asn1_tag_remaining(&data); + + if (data_remaining < 1) { + data.has_error = True; + } else { + + *ticket = data_blob(data.data, data_remaining); + asn1_read(&data, ticket->data, ticket->length); + } + asn1_end_tag(&data); ret = !data.has_error; |