diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-03-22 23:00:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:11 -0500 |
commit | 4c4738938a6681c8691f2c17cbdb23c707272251 (patch) | |
tree | 3c846542daaa1bdb87ad82098822d1020b6f6417 | |
parent | 7c55d0ffa5af6d372ce63ba369a20d9a46fa6454 (diff) | |
download | samba-4c4738938a6681c8691f2c17cbdb23c707272251.tar.gz samba-4c4738938a6681c8691f2c17cbdb23c707272251.tar.bz2 samba-4c4738938a6681c8691f2c17cbdb23c707272251.zip |
r5977: Fix uninitialised memory bug in ndr_pull_ref_ptr(). This fixes the
Test_DoublePointer test failure.
(This used to be commit 4089d5f67d6e4121056a63ececb13187fd773636)
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 3 | ||||
-rw-r--r-- | source4/torture/rpc/echo.c | 25 |
2 files changed, 7 insertions, 21 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 8284375be5..ef52a10efa 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -144,11 +144,10 @@ NTSTATUS ndr_pull_unique_ptr(struct ndr_pull *ndr, uint32_t *v) */ NTSTATUS ndr_pull_ref_ptr(struct ndr_pull *ndr, uint32_t *v) { - NTSTATUS status; NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, v)); /* ref pointers always point to data */ *v = 1; - return status; + return NT_STATUS_OK; } /* diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 34a509a1d4..da775f92fc 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -260,21 +260,21 @@ static BOOL test_sleep(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) i, nt_errstr(status)); ret = False; } else if (r[i].out.result != r[i].in.seconds) { - printf("Failed - Sleeped for %u seconds (but we said %u seconds and the reply takes only %u seconds)\n", + printf("Failed - Slept for %u seconds (but we said %u seconds and the reply takes only %u seconds)\n", r[i].out.result, r[i].in.seconds, (uint_t)diff[i].tv_sec); ret = False; } else { if (r[i].out.result > diff[i].tv_sec) { - printf("Failed - Sleeped for %u seconds (but reply takes only %u.%06u seconds)\n", + printf("Failed - Slept for %u seconds (but reply takes only %u.%06u seconds)\n", r[i].out.result, (uint_t)diff[i].tv_sec, (uint_t)diff[i].tv_usec); } else if (r[i].out.result+1 == diff[i].tv_sec) { - printf("Sleeped for %u seconds (but reply takes %u.%06u seconds - busy server?)\n", + printf("Slept for %u seconds (but reply takes %u.%06u seconds - busy server?)\n", r[i].out.result, (uint_t)diff[i].tv_sec, (uint_t)diff[i].tv_usec); } else if (r[i].out.result == diff[i].tv_sec) { - printf("Sleeped for %u seconds (reply takes %u.%06u seconds - ok)\n", + printf("Slept for %u seconds (reply takes %u.%06u seconds - ok)\n", r[i].out.result, (uint_t)diff[i].tv_sec, (uint_t)diff[i].tv_usec); } else { - printf("(Failed) - Not async - Sleeped for %u seconds (but reply takes %u.%06u seconds)\n", + printf("(Failed) - Not async - Slept for %u seconds (but reply takes %u.%06u seconds)\n", r[i].out.result, (uint_t)diff[i].tv_sec, (uint_t)diff[i].tv_usec); /* TODO: let the test fail here, when we support async rpc on ncacn_np ret = False;*/ @@ -375,20 +375,7 @@ static BOOL test_doublepointer(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } if (value != r.out.result) { - printf("TestSurrounding did not return original value\n"); - ret = False; - } - - pvalue = NULL; - - status = dcerpc_echo_TestDoublePointer(p, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("TestDoublePointer failed - %s\n", nt_errstr(status)); - ret = False; - } - - if (r.out.result != 0) { - printf("TestSurrounding did not return 0 when passed a NULL pointer\n"); + printf("TestDoublePointer did not return original value (%d != %d)\n", value, r.out.result); ret = False; } |