summaryrefslogtreecommitdiff
path: root/librpc/rpc
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-14 17:43:36 +0100
committerGünther Deschner <gd@samba.org>2012-12-21 13:56:00 +0100
commit426bcdb37c05bd5b6ceae34a03b9dbabbf6e9727 (patch)
treeb07343ccf3cfa3afd78363b78f06c7056f9eea65 /librpc/rpc
parent4d02e868f6ad35a408d011e888fba5618bd0c6d9 (diff)
downloadsamba-426bcdb37c05bd5b6ceae34a03b9dbabbf6e9727.tar.gz
samba-426bcdb37c05bd5b6ceae34a03b9dbabbf6e9727.tar.bz2
samba-426bcdb37c05bd5b6ceae34a03b9dbabbf6e9727.zip
librpc: Check return codes of ndr functions.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'librpc/rpc')
-rw-r--r--librpc/rpc/binding.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index f7fbbbc548..ce593490fe 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -424,12 +424,19 @@ _PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
{
DATA_BLOB blob;
+ enum ndr_err_code ndr_err;
struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
ndr->flags |= LIBNDR_FLAG_NOALIGN;
- ndr_push_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
- ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version);
+ ndr_err = ndr_push_GUID(ndr, NDR_SCALARS | NDR_BUFFERS, &syntax->uuid);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return data_blob_null;
+ }
+ ndr_err = ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return data_blob_null;
+ }
blob = ndr_push_blob(ndr);
talloc_steal(mem_ctx, blob.data);