librpc: Add some error checking to dcerpc_floor_pack_rhs_if_version_data
authorVolker Lendecke <vl@samba.org>
Sun, 27 Mar 2011 19:19:37 +0000 (21:19 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 27 Mar 2011 20:22:12 +0000 (22:22 +0200)
librpc/rpc/binding.c

index af47fcea3cae6566db116704e16fda06a51f88bc..381e3aedb54f9d89ffd41baee715eb2601243457 100644 (file)
@@ -443,6 +443,7 @@ static bool dcerpc_floor_pack_rhs_if_version_data(
 {
        DATA_BLOB blob;
        struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx);
+       enum ndr_err_code ndr_err;
 
        if (ndr == NULL) {
                return false;
@@ -450,7 +451,10 @@ static bool dcerpc_floor_pack_rhs_if_version_data(
 
        ndr->flags |= LIBNDR_FLAG_NOALIGN;
 
-       ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version >> 16);
+       ndr_err = ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version >> 16);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               return false;
+       }
 
        blob = ndr_push_blob(ndr);
        talloc_steal(mem_ctx, blob.data);