1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r21592: compress_name() returns NULL for names longer than 15 chars

giving NO_MEMORY back is ugly, so give a useful error

metze
This commit is contained in:
Stefan Metzmacher 2007-02-28 17:23:35 +00:00 committed by Gerald (Jerry) Carter
parent 04da3db29d
commit fbc1e16331

View File

@ -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);