1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

librpc: Fix manually written printer for drsuapi_DsAttributeValue

Credit to OSS-Fuzz

Found using the ndr_fuzz_X target.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2019-12-13 12:19:37 +13:00
parent 5ccb5e23c9
commit 0e651b4508
2 changed files with 9 additions and 7 deletions

View File

@ -113,12 +113,15 @@ static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const cha
ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
ndr->depth++;
if (!convert_string_talloc(ndr,
CH_UTF16, CH_UNIX,
r->blob->data,
r->blob->length,
&p, &converted_size)) {
ndr_print_string(ndr, "string", "INVALID CONVERSION");
if (r->blob == NULL || r->blob->data == NULL) {
ndr_print_string(ndr, "string", "NULL");
} else if (!convert_string_talloc(ndr,
CH_UTF16, CH_UNIX,
r->blob->data,
r->blob->length,
&p, &converted_size)) {
ndr_print_DATA_BLOB(ndr, "string (INVALID CONVERSION)",
*r->blob);
} else {
char *str = (char *)p;
ndr_print_string(ndr, "string", str);

View File

@ -1 +0,0 @@
^samba.tests.blackbox.ndrdump.samba.tests.blackbox.ndrdump.NdrDumpTests.test_fuzzed_drsuapi_DsGetNCChanges