r5977: Fix uninitialised memory bug in ndr_pull_ref_ptr(). This fixes the
authorJelmer Vernooij <jelmer@samba.org>
Tue, 22 Mar 2005 23:00:12 +0000 (23:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:11:11 +0000 (13:11 -0500)
Test_DoublePointer test failure.
(This used to be commit 4089d5f67d6e4121056a63ececb13187fd773636)

source4/librpc/ndr/ndr_basic.c
source4/torture/rpc/echo.c

index 8284375be5aeee3240d77e3a7fd59e2909e7d6fb..ef52a10efa7c1d40b5d67dfb740112a9aa429911 100644 (file)
@@ -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;
 }
 
 /*
index 34a509a1d4d3b8a2d4791d2b4e9b1be6df28a0dd..da775f92fcc1b55f013f64097d3a4c77e777ad40 100644 (file)
@@ -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;
        }