diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-06-02 13:21:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:25 -0500 |
commit | c56ddaf7efdd5744c3f1adb7e40b1db5cbe01523 (patch) | |
tree | 6c707436e36bc62be2a52a1aebc513766fbfd9dc /source4/torture/rpc | |
parent | 180b269ac6fdf89cb4953089cf0f5f1e84f76166 (diff) | |
download | samba-c56ddaf7efdd5744c3f1adb7e40b1db5cbe01523.tar.gz samba-c56ddaf7efdd5744c3f1adb7e40b1db5cbe01523.tar.bz2 samba-c56ddaf7efdd5744c3f1adb7e40b1db5cbe01523.zip |
r7195: - Fix echo pipe
- Don't allocate strings
- Give higher preference to the [out] part of variables when they
are being used by another [out] variable. Also make sure that
[in] variables never use [out] variables (i.e. switch_is() on an
[in] variable can no longer use an [out] variable).
(This used to be commit 837c83d77a2d1990419c4f3e343616daf8da5799)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/echo.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 14bfe573ce..96a716a312 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -107,15 +107,11 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) int i; NTSTATUS status; int len = 200000 + (random() % 5000); - uint8_t *data_out; struct echo_SourceData r; printf("\nTesting SourceData\n"); - data_out = talloc_size(mem_ctx, len); - r.in.len = len; - r.out.data = data_out; status = dcerpc_echo_SourceData(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { @@ -124,9 +120,9 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } for (i=0;i<len;i++) { - uint8_t *v = (uint8_t *)data_out; + uint8_t *v = (uint8_t *)r.out.data; if (v[i] != (i & 0xFF)) { - printf("bad data 0x%x at %d\n", (uint8_t)data_out[i], i); + printf("bad data 0x%x at %d\n", (uint8_t)r.out.data[i], i); return False; } } @@ -199,6 +195,7 @@ static BOOL test_testcall2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) for (i=1;i<=7;i++) { r.in.level = i; + r.out.info = talloc(mem_ctx, union echo_Info); printf("\nTesting TestCall2 level %d\n", i); status = dcerpc_echo_TestCall2(p, mem_ctx, &r); |