libcli/nbt: fix ndr_push_nbt_string() string labels with a length of 63 (0x3F) are...
[ira/wip.git] / libcli / nbt / nbtname.c
index 792b340618e73c6df3318553e424c3db674cc968..136379a313f9e54ee562e59ef0b64a03f0d17b76 100644 (file)
@@ -173,9 +173,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla
                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);
                }