From f35373709444780c4bf338c17b26ce9cc3ebab50 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Sep 2007 13:31:05 +0000 Subject: r25212: merge some stuff from samba3 metze (This used to be commit 502251451aa78b82131283d0590b382943b1d156) --- source4/libcli/util/asn1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index 7e2d54fcbd..f2098de5c5 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -360,6 +360,9 @@ BOOL asn1_load(struct asn1_data *data, DATA_BLOB blob) /* Peek into an ASN1 buffer, not advancing the pointer */ BOOL asn1_peek(struct asn1_data *data, void *p, int len) { + if (data->has_error) + return False; + if (len < 0 || data->ofs + len < data->ofs || data->ofs + len < len) return False; @@ -405,7 +408,7 @@ BOOL asn1_peek_tag(struct asn1_data *data, uint8_t tag) return False; } - if (!asn1_peek(data, &b, sizeof(b))) + if (!asn1_peek_uint8(data, &b)) return False; return (b == tag); -- cgit