ldap: Correctly check asn1_tag_remaining retval
authorVolker Lendecke <vl@samba.org>
Mon, 11 Jan 2016 20:49:21 +0000 (21:49 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 3 Feb 2016 14:04:11 +0000 (15:04 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
libcli/ldap/ldap_message.c

index 76d2ee95c94fd969faa947a5c4b85c97d393bfe0..c89705bbf4102b155f38f456f84a03e20eafe1d2 100644 (file)
@@ -886,7 +886,7 @@ static struct ldb_parse_tree *ldap_decode_filter_tree(TALLOC_CTX *mem_ctx,
                        goto failed;
                }
 
-               while (asn1_tag_remaining(data)) {
+               while (asn1_tag_remaining(data) > 0) {
                        if (!asn1_peek_uint8(data, &subs_tag)) goto failed;
                        subs_tag &= 0x1f;       /* strip off the asn1 stuff */
                        if (subs_tag > 2) goto failed;