diff options
author | Günther Deschner <gd@samba.org> | 2010-04-30 01:45:44 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-30 01:45:44 +0200 |
commit | f2ccff806a5118ff1ff8a24aa85f56be61906d3a (patch) | |
tree | a5a96b891e403b81dfadf79bebca46dd9c49a926 /source4/torture | |
parent | 93a9563a42cd0b1a81bb2cc3bd2c9f3473043463 (diff) | |
download | samba-f2ccff806a5118ff1ff8a24aa85f56be61906d3a.tar.gz samba-f2ccff806a5118ff1ff8a24aa85f56be61906d3a.tar.bz2 samba-f2ccff806a5118ff1ff8a24aa85f56be61906d3a.zip |
s4-smbtorture: fix rap_pull_rap_PrintQueue2 and 4.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rap/rap.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c index 5feea7da50..739d44e518 100644 --- a/source4/torture/rap/rap.c +++ b/source4/torture/rap/rap.c @@ -594,8 +594,15 @@ static NTSTATUS rap_pull_rap_PrintQueue1(TALLOC_CTX *mem_ctx, struct ndr_pull *n static NTSTATUS rap_pull_rap_PrintQueue2(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr, uint16_t convert, struct rap_PrintQueue2 *r) { + int i; RAP_RETURN(rap_pull_rap_PrintQueue1(mem_ctx, ndr, convert, &r->queue)); - RAP_RETURN(rap_pull_rap_JobInfo1(mem_ctx, ndr, convert, &r->job)); + r->job = talloc_zero_array(mem_ctx, struct rap_PrintJobInfo1, r->queue.PrintJobCount); + if (r->job == NULL) { + return NT_STATUS_NO_MEMORY; + } + for (i=0; i < r->queue.PrintJobCount; i++) { + RAP_RETURN(rap_pull_rap_JobInfo1(mem_ctx, ndr, convert, &r->job[i])); + } return NT_STATUS_OK; } @@ -622,8 +629,15 @@ static NTSTATUS rap_pull_rap_PrintQueue3(TALLOC_CTX *mem_ctx, struct ndr_pull *n static NTSTATUS rap_pull_rap_PrintQueue4(TALLOC_CTX *mem_ctx, struct ndr_pull *ndr, uint16_t convert, struct rap_PrintQueue4 *r) { + int i; RAP_RETURN(rap_pull_rap_PrintQueue3(mem_ctx, ndr, convert, &r->queue)); - RAP_RETURN(rap_pull_rap_JobInfo2(mem_ctx, ndr, convert, &r->job)); + r->job = talloc_zero_array(mem_ctx, struct rap_PrintJobInfo2, r->queue.PrintJobCount); + if (r->job == NULL) { + return NT_STATUS_NO_MEMORY; + } + for (i=0; i < r->queue.PrintJobCount; i++) { + RAP_RETURN(rap_pull_rap_JobInfo2(mem_ctx, ndr, convert, &r->job[i])); + } return NT_STATUS_OK; } |