summaryrefslogtreecommitdiff
path: root/source3/librpc/ndr/ndr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/librpc/ndr/ndr.c')
-rw-r--r--source3/librpc/ndr/ndr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c
index 3ceb728a3f..26bda33723 100644
--- a/source3/librpc/ndr/ndr.c
+++ b/source3/librpc/ndr/ndr.c
@@ -330,6 +330,8 @@ static NTSTATUS ndr_map_error(enum ndr_err_code ndr_err)
return NT_STATUS_ARRAY_BOUNDS_EXCEEDED;
case NDR_ERR_INVALID_POINTER:
return NT_STATUS_INVALID_PARAMETER_MIX;
+ case NDR_ERR_UNREAD_BYTES:
+ return NT_STATUS_PORT_MESSAGE_TOO_LONG;
default:
break;
}
@@ -711,7 +713,9 @@ NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, vo
status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
if (!NT_STATUS_IS_OK(status)) return status;
if (ndr->offset < ndr->data_size) {
- return NT_STATUS_PORT_MESSAGE_TOO_LONG;
+ return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
+ "not all bytes consumed ofs[%u] size[%u]",
+ ndr->offset, ndr->data_size);
}
return NT_STATUS_OK;
}
@@ -749,7 +753,9 @@ _PUBLIC_ NTSTATUS ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem
status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
if (!NT_STATUS_IS_OK(status)) return status;
if (ndr->offset < ndr->data_size) {
- return NT_STATUS_PORT_MESSAGE_TOO_LONG;
+ return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
+ "not all bytes consumed ofs[%u] size[%u]",
+ ndr->offset, ndr->data_size);
}
return NT_STATUS_OK;
}