summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-02-28 17:23:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:02 -0500
commit7f13043d7eed4ee907bda688b5e10bef233871f5 (patch)
tree53de4fe738717c25baec7932e711d0d6e16be87c
parent505fd4eb9901a1ff8ecbd244fe2227eae59ca2d6 (diff)
downloadsamba-7f13043d7eed4ee907bda688b5e10bef233871f5.tar.gz
samba-7f13043d7eed4ee907bda688b5e10bef233871f5.tar.bz2
samba-7f13043d7eed4ee907bda688b5e10bef233871f5.zip
r21592: compress_name() returns NULL for names longer than 15 chars
giving NO_MEMORY back is ugly, so give a useful error metze (This used to be commit fbc1e16331c5957892e4bfc439ea5c4e0387b32e)
-rw-r--r--source4/libcli/nbt/nbtname.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index 871e29794d..584af96984 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -332,6 +332,12 @@ _PUBLIC_ NTSTATUS ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, const s
return NT_STATUS_OK;
}
+ if (strlen(r->name) > 15) {
+ return ndr_push_error(ndr, NDR_ERR_STRING,
+ "nbt_name longer as 15 chars: %s",
+ r->name);
+ }
+
cname = compress_name(ndr, (const uint8_t *)r->name, r->type);
NT_STATUS_HAVE_NO_MEMORY(cname);