dns: Fix offset check in ndr_pull_component
authorKai Blin <kai@samba.org>
Fri, 30 Sep 2011 02:31:07 +0000 (19:31 -0700)
committerKai Blin <kai@samba.org>
Fri, 4 Nov 2011 16:25:16 +0000 (17:25 +0100)
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Fri Nov  4 17:25:16 CET 2011 on sn-devel-104

librpc/ndr/ndr_dns.c

index 1004db0042fb57127a70fa18bf7314c40f47f522..27d849377735ba225a1dd1433423f20d92c71270 100644 (file)
@@ -88,7 +88,7 @@ static enum ndr_err_code ndr_pull_component(struct ndr_pull *ndr,
                                              "reserved lenght field: 0x%02x",
                                              (len &0xC));
                }
-               if (*offset + len + 2 > ndr->data_size) {
+               if (*offset + len + 1 > ndr->data_size) {
                        return ndr_pull_error(ndr, NDR_ERR_STRING,
                                              "BAD DNS NAME component, "\
                                              "length too long");