libcli/nbt: fix ndr_push_nbt_string() string labels with a length of 63 (0x3F) are...
authorStefan Metzmacher <metze@samba.org>
Mon, 1 Feb 2010 14:18:15 +0000 (15:18 +0100)
committerStefan Metzmacher <metze@sernet.de>
Mon, 1 Feb 2010 17:30:40 +0000 (18:30 +0100)
metze
(cherry picked from commit e37dc56e971f44c00791529a39144d1a972e3ca2)

Signed-off-by: Stefan Metzmacher <metze@sernet.de>
source/libcli/nbt/nbtname.c

index b30a07be0b595317f69bd7190b648d047fd6d4f3..1714210d67b02f76b5f10492f78297f9f0cb3480 100644 (file)
@@ -169,9 +169,9 @@ NTSTATUS ndr_push_nbt_string(struct ndr_push *ndr, int ndr_flags, const char *s)
                complen = strcspn(s, ".");
 
                /* we need to make sure the length fits into 6 bytes */
-               if (complen >= 0x3F) {
+               if (complen > 0x3F) {
                        return ndr_push_error(ndr, NDR_ERR_STRING,
-                                             "component length %u[%08X] > 0x00003F",
+                                             "component length %u[%08X] > 0x0000003F",
                                              (unsigned)complen, (unsigned)complen);
                }