summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-17 10:04:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:02 -0500
commit69d643535837bc23d8f7274ce476cf803b45969b (patch)
treeb6d34a5e20595e8ab0298717c8002c0753dc4adb /source4/libcli
parent0320233d15a21eff92c10824d5c4baa785e1579a (diff)
downloadsamba-69d643535837bc23d8f7274ce476cf803b45969b.tar.gz
samba-69d643535837bc23d8f7274ce476cf803b45969b.tar.bz2
samba-69d643535837bc23d8f7274ce476cf803b45969b.zip
r1851: if we try to peek a subtag, check if the parent tag has remaining data
metze (This used to be commit 01626ed381bdc9cab3e94e80220c916bb61acf30)
Diffstat (limited to 'source4/libcli')
-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;