summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/util/asn1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index 6dc459d59d..e7c38b2803 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -264,6 +264,10 @@ BOOL asn1_peek_tag(ASN1_DATA *data, uint8_t tag)
{
uint8_t b;
+ if (asn1_tag_remaining(data) <= 0) {
+ return False;
+ }
+
if (!asn1_peek(data, &b, sizeof(b)))
return False;