ndrdump: Check return value of ndr_pull_init_blob().
authorAndreas Schneider <asn@samba.org>
Tue, 19 Feb 2013 07:56:22 +0000 (08:56 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:12 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
librpc/tools/ndrdump.c

index 4a102f52690d5b29bfe20faaca6406029fbd37fc..7247d8030091ec41295ce966eff6126d61c5a3b2 100644 (file)
@@ -335,6 +335,10 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
                blob.length = size;
 
                ndr_pull = ndr_pull_init_blob(&blob, mem_ctx);
+               if (ndr_pull == NULL) {
+                       perror("ndr_pull_init_blob");
+                       exit(1);
+               }
                ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
                if (assume_ndr64) {
                        ndr_pull->flags |= LIBNDR_FLAG_NDR64;
@@ -377,6 +381,10 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
        blob.length = size;
 
        ndr_pull = ndr_pull_init_blob(&blob, mem_ctx);
+       if (ndr_pull == NULL) {
+               perror("ndr_pull_init_blob");
+               exit(1);
+       }
        ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
        if (assume_ndr64) {
                ndr_pull->flags |= LIBNDR_FLAG_NDR64;
@@ -459,6 +467,10 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char *function,
                }
 
                ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx);
+               if (ndr_v_pull == NULL) {
+                       perror("ndr_pull_init_blob");
+                       exit(1);
+               }
                ndr_v_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
 
                ndr_err = f->ndr_pull(ndr_v_pull, flags, v_st);