From 15e84a9a09c5a86416e964a3258ee35718fbf45a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 24 Mar 2011 10:59:41 +1100 Subject: charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*() we shouldn't accept bad multi-byte strings, it just hides problems Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104 --- librpc/ndr/ndr_drsuapi.c | 2 +- librpc/ndr/ndr_string.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'librpc') diff --git a/librpc/ndr/ndr_drsuapi.c b/librpc/ndr/ndr_drsuapi.c index 86ecdcb861..35216ff19d 100644 --- a/librpc/ndr/ndr_drsuapi.c +++ b/librpc/ndr/ndr_drsuapi.c @@ -109,7 +109,7 @@ static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const cha CH_UTF16, CH_UNIX, r->blob->data, r->blob->length, - (void **)&str, NULL, false)) { + (void **)&str, NULL)) { ndr_print_string(ndr, "string", "INVALID CONVERSION"); } else { ndr_print_string(ndr, "string", str); diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c index 610676cf78..402cf4e4ad 100644 --- a/librpc/ndr/ndr_string.c +++ b/librpc/ndr/ndr_string.c @@ -86,7 +86,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, ndr->data+ndr->offset, (len2 + c_len_term)*byte_mul, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -124,7 +124,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, ndr->data+ndr->offset, (len1 + c_len_term)*byte_mul, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -163,7 +163,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, ndr->data+ndr->offset, (len1 + c_len_term)*byte_mul, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -198,7 +198,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, ndr->data+ndr->offset, (len3 + c_len_term)*byte_mul, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -230,7 +230,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, CH_UNIX, ndr->data+ndr->offset, len3, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -249,7 +249,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, len1, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -274,7 +274,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, CH_UNIX, ndr->data+ndr->offset, len1, (void **)(void *)&as, - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion with flags 0x%x", flags); @@ -334,7 +334,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags, s_len++; } if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len, - (void **)(void *)&dest, &d_len, false)) + (void **)(void *)&dest, &d_len)) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, "Bad character push conversion with flags 0x%x", flags); @@ -684,7 +684,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, if (!convert_string_talloc(ndr->current_mem_ctx, chset, CH_UNIX, ndr->data+ndr->offset, length*byte_mul, discard_const_p(void *, var), - &converted_size, false)) + &converted_size)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion"); @@ -707,7 +707,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, NDR_PUSH_NEED_BYTES(ndr, required); ret = convert_string(CH_UNIX, chset, var, strlen(var), - ndr->data+ndr->offset, required, false); + ndr->data+ndr->offset, required); if (ret == -1) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, "Bad character conversion"); -- cgit