+ NDR_PULL_NEED_BYTES(ndr, conv_src_len * byte_mul);
+ if (conv_src_len == 0) {
+ as = talloc_strdup(ndr->current_mem_ctx, "");
+ } else {
+ if (!convert_string_talloc(ndr->current_mem_ctx, chset,
+ CH_UNIX, ndr->data + ndr->offset,
+ conv_src_len * byte_mul,
+ (void **)(void *)&as,
+ &converted_size)) {
+ return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
+ "Bad character conversion with flags 0x%x", flags);
+ }
+ }
+
+ /* this is a way of detecting if a string is sent with the wrong
+ termination */
+ if (ndr->flags & LIBNDR_FLAG_STR_NOTERM) {
+ if (strlen(as) < conv_src_len) {
+ DEBUG(6,("short string '%s'\n", as));
+ }
+ } else {
+ if (strlen(as) == conv_src_len) {
+ DEBUG(6,("long string '%s'\n", as));
+ }
+ }
+
+ NDR_CHECK(ndr_pull_advance(ndr, conv_src_len * byte_mul));
+ *s = as;
+