r4491: don't dereference q1.out.sam unless we know it is not NULL
authorAndrew Tridgell <tridge@samba.org>
Sun, 2 Jan 2005 23:36:02 +0000 (23:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:12 +0000 (13:08 -0500)
(This used to be commit 77e14c28584c5917f22672b304cb0f8e37e883fd)

source4/torture/rpc/samr.c

index a599dabe154f7501d0620cdf6f6c0c3cac216c8f..ae62f94cb00ae5a88d5e38d988eb6366a8c00dce 100644 (file)
@@ -2562,7 +2562,7 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                    !NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES))
                        break;
 
                    !NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES))
                        break;
 
-               for (i=0; i<q1.out.sam->count; i++) {
+               for (i=0; i<q1.out.num_entries; i++) {
                        add_string_to_array(mem_ctx,
                                            q1.out.sam->entries[i].name.string,
                                            &names, &num_names);
                        add_string_to_array(mem_ctx,
                                            q1.out.sam->entries[i].name.string,
                                            &names, &num_names);