librpc: Check return codes of ndr functions.
authorAndreas Schneider <asn@samba.org>
Fri, 14 Dec 2012 16:43:36 +0000 (17:43 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 21 Dec 2012 12:56:00 +0000 (13:56 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
librpc/rpc/binding.c

index f7fbbbc548bf47cf60c5d7bd3add38f12bae5231..ce593490fe1e2fb09a8dbde7dcb718e436f91fe5 100644 (file)
@@ -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);