diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-24 07:32:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:11 -0500 |
commit | 82b61938ac86cdca9f9394da6c291976062c5559 (patch) | |
tree | a8413f2a986631711bef985d2dd66ff6aa9605b5 /source4/torture | |
parent | 1954070a7e212cea26f36db5cc6772951327a64e (diff) | |
download | samba-82b61938ac86cdca9f9394da6c291976062c5559.tar.gz samba-82b61938ac86cdca9f9394da6c291976062c5559.tar.bz2 samba-82b61938ac86cdca9f9394da6c291976062c5559.zip |
r2593: don't crash if the server doesn't know that 0 count searches mean 1
(This used to be commit 640ced453092a5c5f3ffe7ee0fe4be804a4ced14)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/raw/search.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index a767cb2a70..3eb1d2d8e1 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -772,13 +772,17 @@ static BOOL test_modify_search(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) &io, &result, multiple_search_callback); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(result.count, 1); - + io2.generic.level = RAW_SEARCH_BOTH_DIRECTORY_INFO; io2.t2fnext.in.handle = io.t2ffirst.out.handle; io2.t2fnext.in.max_count = num_files/2 - 1; io2.t2fnext.in.resume_key = 0; io2.t2fnext.in.flags = 0; - io2.t2fnext.in.last_name = result.list[result.count-1].both_directory_info.name.s; + if (result.count == 0) { + io2.t2fnext.in.last_name = ""; + } else { + io2.t2fnext.in.last_name = result.list[result.count-1].both_directory_info.name.s; + } status = smb_raw_search_next(cli->tree, mem_ctx, &io2, &result, multiple_search_callback); |